摘要:
For the exercises in this chapter we need a list of English words. There are lots of word lists available on the Web, but the most suitable for our pu... 阅读全文
摘要:
The operators we have seen so far are all special characters like + and *, but there are a few operators that are words. in is a boolean operator that... 阅读全文
摘要:
A method is similar to a function – it takes arguments and returns a value – but the syntax is different. For example, the method upper takes a string... 阅读全文
摘要:
六月尾了,多么青春的月份。世界杯伴随着高考结束大学毕业,转眼从事软件测试工作四年了。想想当初,培训老师口中的朝阳行业软件测试,到现在依旧朝阳,只能呵呵。先说说主页君自己,由于他腹黑阴险狡猾,不做测试挺可惜的,所以四年前毅然选择了软件测试这个行当,要说后悔,基本没有,唯一遗憾的是当年应该先去做两年开发... 阅读全文
摘要:
Find: In a sense, find is the opposite of the [] operator. Instead of taking an index and extracting the corresponding character, it takes a... 阅读全文
摘要:
It is tempting to use the [] operator on the left side of an assignment, with the intention of changing a character in a string. The ‘object... 阅读全文
摘要:
String slicesA segment of a string is called a slice. Selecting a slice is similar selecting a character: The operator [n:m] returns the par... 阅读全文
摘要:
A lot of computations involve processing a string one character at a time. Often they start at the beginning, select each character in turn, do someth... 阅读全文
摘要:
len is a build-in function that returns the numbers of characters in a string: Since we started counting at zero, the last index should be 5... 阅读全文
摘要:
A string is a sequence of characters. You can access the characters one at a time with the bracket operator. The second statement selects ch... 阅读全文