在下面的例子中,函数返回某个字符串的连续小写字母。
In the following example, a function returns the successive lowercase characters of a string.
它们只是分别将字符串都转换成大写字母或小写字母。
They simply convert the string to all uppercase or all lowercase letters, respectively.
例外情况,一个监听器将输入字符串转换成大写字母,而另一个将其转换成小写字母,这对于监听器所编写的代码都是完全相同的。
With the exception that one of the listeners converts the input string to uppercase, while the second converts the string to lowercase, the code for the listeners is exactly the same.
还可以用混合大小写字母的形式拼写字符串。
You can also spell the strings using mixed uppercase and lowercase letters.
下面这些函数都试图检查一个字符串是不是包含小写字母,但他们当中肯定有些是错的。
The following functions are all intended to check whether a string contains any lowercase letters, but at least some of them are wrong.
在这个函数中我们做的第一件事是将两个字符串转化成小写字母。
The first thing we do in this function is to convert both strings to all lowercase.
第一行输入包含一个字符串。它一定一个非空,只含小写字母,且长度不超过100的串。
The first input line contains the string. It's guaranteed, that the string is non-empty, consists of lower-case Latin letters, and its length doesn't exceed 100.
返回一个字符串,该字符串中的所有字母都被转换为小写字母。
Returns a string where all alphabetic characters have been converted to lowercase.
我们随机选择4到7个小写字母,一次一个的连结到我们的字符串。
To put it together, we randomly choose between 4 and 7 random lowercase letters, concatenating each letter to our string one at a time.
注意:假定字符串中只包含小写字母。
Note: You may assume the string contain only lowercase letters.
注意:假定字符串中只包含小写字母。
Note: You may assume the string contain only lowercase letters.
应用推荐