string
string - Manipulate strings
string option arg ?arg ...?
NAME
string - Manipulate strings
SYNOPSIS
stringoption arg ?arg ...?
DESCRIPTION
Performs one of several string operations, depending on option. The legal options (which may be abbreviated) are:
- string compare string1 string2
- string first string1 string2
- string index string charIndex
- string last string1 string2
- string length string
- string match pattern string
- *
- ?
- [chars]
- \x
- string range string first last
- string tolower string
- string totitle string
- string toupper string
- string trim string ?chars?
- string trimleft string ?chars?
- string trimright string ?chars?
- string wordend string index
- string wordstart string index
Perform a character-by-character comparison of strings string1 and string2 in the same way as the C strcmp procedure. Return -1, 0, or 1, depending on whether string1 is lexicographically less than, equal to, or greater than string2.
Search string2 for a sequence of characters that exactly match the characters in string1. If found, return the index of the first character in the first such match within string2. If not found, return -1.
Returns the charIndex'th character of the string argument. A charIndex of 0 corresponds to the first character of the string. If charIndex is less than 0 or greater than or equal to the length of the string then an empty string is returned.
Search string2 for a sequence of characters that exactly match the characters in string1. If found, return the index of the first character in the last such match within string2. If there is no match, then return -1.
Returns a decimal string giving the number of characters in string.
See if pattern matches string; return 1 if it does, 0 if it doesn't. Matching is done in a fashion similar to that used by the C-shell. For the two strings to match, their contents must be identical except that the following special sequences may appear in pattern:
Matches any sequence of characters in string, including a null string.
Matches any single character in string.
Matches any character in the set given by chars. If a sequence of the form x-y appears in chars, then any character between x and y, inclusive, will match.
Matches the single character x. This provides a way of avoiding the special interpretation of the characters *?[]\ in pattern.
Returns a range of consecutive characters from string, starting with the character whose index is first and ending with the character whose index is last. An index of 0 refers to the first character of the string. An index of end (or any abbreviation of it) refers to the last character of the string. If first is less than zero then it is treated as if it were zero, and if last is greater than or equal to the length of the string then it is treated as if it were end. If first is greater than last then an empty string is returned.
Returns a value equal to string except that all upper (or title) case letters have been converted to lower case.
Returns a value equal to string except that the first character in string is converted to its Unicode title case variant (or upper case if there is no title case variant) and the rest of the string is converted to lower case.
Returns a value equal to string except that all lower (or title) case letters have been converted to upper case.
Returns a value equal to string except that any leading or trailing characters from the set given by chars are removed. If chars is not specified then white space is removed (spaces, tabs, newlines, and carriage returns).
Returns a value equal to string except that any leading characters from the set given by chars are removed. If chars is not specified then white space is removed (spaces, tabs, newlines, and carriage returns).
Returns a value equal to string except that any trailing characters from the set given by chars are removed. If chars is not specified then white space is removed (spaces, tabs, newlines, and carriage returns).
Returns the index of the character just after the last one in the word containing character index of string. A word is considered to be any contiguous range of alphanumeric (Unicode letters or decimal digits) or underscore (Unicode connector punctuation) characters, or any single character other than these.
Returns the index of the first character in the word containing character index of string. A word is considered to be any contiguous range of alphanumeric (Unicode letters or decimal digits) or underscore (Unicode connector punctuation) characters, or any single character other than these.
KEYWORDS
case conversion, compare, index, match, pattern, string, word
Copyright © 1993 The Regents of the University of California.Copyright © 1994-1996 Sun Microsystems, Inc.Copyright © 1995-1997 Roger E. Critchlow Jr.