当从原始的输入数据中提取字符串时,试着从原始字符串返回一个子字符串,而不是创建一份拷贝。
When extracting strings from a set of input data, try to return a substring of the original data, instead of creating a copy.
LOCATE LOCATE ('beach ',p. d escription)返回一个子字符串在搜索字符串中第一次出现的起始位置,如果没找到子字符串,则返回0。
LOCATE LOCATE (' beach ', p.description) Returns the starting location for the first occurrence of a substring in a search string, or zero if the substring isn't found.
然后,split方法返回一个数组,其中保存了根据空格字符将给定字符串分割成子字符串的结果。
The split method then returns an array holding the strings that resulted from separating the given string into substrings, as delimited by the space character.
它查看与第一个例子相同的子字符串系列,但是bash从初始字符串除去最短的匹配,然后返回结果。
It checks the same set of substrings as our first example did, except that bash removes the shortest match from our original string, and returns the result.
toCollection方法以空格来分割字符串,然后返回一个包含这些子字符串的Array(数组)。
The toCollection method splits a string on spaces and returns an Array containing the substrings.
返回带格式字符串的子字符串,也可以选择包含密码字符。
Returns a substring of the formatted string, optionally including password characters.
返回带格式字符串的子字符串,也可以选择包含提示字符和原义字符。
Returns a substring of the formatted string, optionally including prompt and literal characters.
搜索指定的子字符串,并返回整个源字符串内最后一个匹配项的从零开始的索引。
Searches for the specified character and returns the zero-based index of the last occurrence within the entire source string.
返回通过连接一个数组中包含的若干子字符串创建的字符串。
Returns a string created by joining a number of substrings contained in an array.
搜索指定的子字符串,并返回源字符串内从指定的索引位置到字符串结尾这一部分中第一个匹配项的从零开始的索引。
Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string.
搜索指定的子字符串,并返回源字符串内从指定的索引位置到字符串结尾这一部分中第一个匹配项的从零开始的索引。
Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string.
应用推荐