|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectString
public class String
An object representing a series of characters in a string. The String object is a wrapper around the string primitive data type. Do not confuse a string literal with the String object.
| Field Summary | |
|---|---|
Number |
length
Reflects the length of the string. |
| Method Summary | |
|---|---|
String |
charAt(Number index)
Returns the specified character from the string. |
Number |
charCodeAt(Number index)
Returns a number indicating the Unicode value of the character at the given index. |
String |
fromCharCode(Number... charCode)
Returns a string created by using the specified sequence of Unicode values. |
Number |
indexOf(String searchValue,
Number fromIndex)
Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex, or -1 if the value is not found. |
Number |
lastIndexOf(String searchValue,
Number fromIndex)
Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found. |
String[] |
match(RegExp regexp)
Used to match a regular expression against a string. |
String[] |
replace(RegExp regexp,
String newSubStr,
Function func)
Finds a match between a regular expression and a string, and replaces the matched substring with a new substring. |
String |
substring(Number start,
Number end)
Returns a subset of a String object. |
String |
toLowerCase()
Returns the calling string value converted to lowercase. |
String |
toUpperCase()
Returns the calling string value converted to uppercase. |
| Methods inherited from class Object |
|---|
toString |
| Field Detail |
|---|
public Number length
| Method Detail |
|---|
public String[] replace(RegExp regexp,
String newSubStr,
Function func)
regexp - Name of the regular expression. It can be a variable name or a literal.newSubStr - The string to put in place of the string found with regexp.func - A function to be invoked after the match has been performed.public String toUpperCase()
public String fromCharCode(Number... charCode)
charCode - An integer between 0 and 1 less than the length of the string. The default value is 0.public Number charCodeAt(Number index)
index - An integer between 0 and 1 less than the length of the string. The default value is 0.public String toLowerCase()
public String substring(Number start,
Number end)
start - An integer between 0 and 1 less than the length of the string.end - An integer between 0 and 1 less than the length of the string.
public Number lastIndexOf(String searchValue,
Number fromIndex)
searchValue - A string representing the value to search for.fromIndex - The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is the length of the string.public String[] match(RegExp regexp)
Used to match a regular expression against a string.
If the regular expression does not include the g flag, returns the same result that RegExp.exec would return on the regular expression and string. If the regular expression includes the g flag, returns an array of all the matches of the regular expression in the string.
Note If you execute a match simply to find true or false, use String.search or the regular expression test method.
regexp - Name of the regular expression. It can be a variable name or a literal.
public Number indexOf(String searchValue,
Number fromIndex)
searchValue - A string representing the value to search for.fromIndex - The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.public String charAt(Number index)
index - An integer between 0 and 1 less than the length of the string.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||