Changes between Version 7 and Version 8 of StdLib2/StringLib
- Timestamp:
- 07/14/09 14:27:22 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StdLib2/StringLib
v7 v8 35 35 Compares the string to the string `other`, and returns an integer. This function ignores case, so `"foo"`, `"Foo"`, and `"fOO"` will all compare the same. The return values are the same as `.compare()`. 36 36 37 == '''`s.find(sub: string|char )`''' ==37 == '''`s.find(sub: string|char, start: int = 0)`''' == 38 38 39 Searches for an occurence of `sub` in the string. `sub` can be either a string or a single character. The search starts from the first character of the stringand goes right. If `sub` is found, this function returns the integer index of the occurrence in the string, with 0 meaning the first character. Otherwise, `#s` is returned.39 Searches for an occurence of `sub` in the string. `sub` can be either a string or a single character. The search starts from `start` (which defaults to the first character) and goes right. If `sub` is found, this function returns the integer index of the occurrence in the string, with 0 meaning the first character. Otherwise, `#s` is returned. 40 40 41 == '''`s.ifind(sub: string|char )`''' ==41 == '''`s.ifind(sub: string|char, start: int = 0)`''' == 42 42 43 Searches for an occurence of `sub` in the string. `sub` can be either a string or a single character. This search is not case-sensitive. The search starts from the first character of the stringand goes right. If `sub` is found, this function returns the integer index of the occurrence in the string, with 0 meaning the first character. Otherwise, `#s` is returned.43 Searches for an occurence of `sub` in the string. `sub` can be either a string or a single character. This search is not case-sensitive. The search starts from `start` (which defaults to the first character) and goes right. If `sub` is found, this function returns the integer index of the occurrence in the string, with 0 meaning the first character. Otherwise, `#s` is returned. 44 44 45 == '''`s.rfind(sub: string|char )`''' ==45 == '''`s.rfind(sub: string|char, start: int = #s)`''' == 46 46 47 Searches for an occurence of `sub` in the string. `sub` can be either a string or a single character. The search starts from the last character of the string and goes left. If `sub` is found, this function returns the integer index of the occurrence in the string, with 0 meaning the first character. Otherwise, `#s` is returned.47 Searches for an occurence of `sub` in the string. `sub` can be either a string or a single character. The search starts with the character at `start - 1` (which defaults to the last character) and goes left. `start` is not included in the search so you can use the result of this function as the `start` parameter to successive calls. If `sub` is found, this function returns the integer index of the occurrence in the string, with 0 meaning the first character. Otherwise, `#s` is returned. 48 48 49 == '''`s.irfind(sub: string|char )`''' ==49 == '''`s.irfind(sub: string|char, start: int = #s)`''' == 50 50 51 Searches for an occurence of `sub` in the string. `sub` can be either a string or a single character. This search is not case-sensitive. The search starts from the last character of the string and goes left. If `sub` is found, this function returns the integer index of the occurrence in the string, with 0 meaning the first character. Otherwise, `#s` is returned.51 Searches for an occurence of `sub` in the string. `sub` can be either a string or a single character. This search is not case-sensitive. The search starts with the character at `start - 1` (which defaults to the last character) and goes left. `start` is not included in the search so you can use the result of this function as the `start` parameter to successive calls. If `sub` is found, this function returns the integer index of the occurrence in the string, with 0 meaning the first character. Otherwise, `#s` is returned. 52 52 53 53 == '''`s.toLower()`''' ==