String¶
Definition¶
Extends¶
Extended By¶
None
Description¶
A sequence of characters
Method Summary¶
Owner | Name | Return Type | Description |
---|---|---|---|
String | constructor(s) | Object | Initialize a string object |
String | after(toFind, origIfNotFound) | String | Get the portion of a string after the first occurence of a delimiter. If the delimiter is not found, then return either the original string or null depending on origIfNotFound param. Same as AmiScript strAfter(). |
String | afterLast(toFind, origIfNotFound) | String | Get the portion of a string after the last occurence of a delimiter. If the delimiter is not found, then return either the original string or null depending on origIfNotFound param. Same as AmiScript strAfterLast(). |
String | before(toFind, origIfNotFound) | String | Get the portion of a string before the first occurence of a delimiter. If the delimiter is not found, then return either the original string or null depending on origIfNotFound param. Same as AmiScript strBefore(). |
String | beforeLast(toFind, origIfNotFound) | String | Get the portion of a string before the last occurrence of a delimiter. If the delimiter is not found, then return either the original string or null depending on origIfNotFound param. |
String | charAt(index) | Character | Returns the character at the specified index. Equivalent to the AmiScript method strChartAt(). |
String | chars() | List | Returns a list whose length is the length of this string and whose contents are initialized to contain the character sequence represented by this string. |
String | cut(delim, fieldList) | String | Splits string using the supplied delimiter based on the supplied field positions. The string returned is the resulting strings or characters at the field positions joined by the delimiter. Same as AmiScript method strCut(). |
String | decodeToByte() | Byte | Decodes a string into a byte. Must be a number without any suffix. |
String | decodeToLong() | Long | Decodes a string into a long. Must be a number without any suffix. |
String | decodeToShort() | Short | Decodes a string into a short. Must be a number without any suffix. |
String | endsWith(suffix, ignore_case) | Boolean | Returns "true" if this string ends with the specified suffix, "false" otherwise. Same as AmiScript method strEndsWith(). |
Object | getClassName() | String | Returns the string name of this object's class type. |
String | indexOf(to_find) | Integer | Returns the index within this string of the first occurrence of the specified string, returns -1 if no such occurrence is found. Same as AmiScript method strIndexOf() with one argument. |
String | indexOf(to_find, start_index) | Integer | Returns the index within this string of the first occurrence of the specified string, starting from a specific index, returns -1 if no such occurrence is found. Same as AmiScript method strIndexOf() with two arguments. |
String | is() | Boolean | Returns "true" if the string contains characters other than whitespace characters, such as tabs, newlines, and spaces; returns "false" otherwise. Same as strIs(). Opposite of isnt(). |
String | isEmpty() | Boolean | Returns "true" if, and only if, length() is 0 (i.e, an empty string). |
String | isnt() | Boolean | Returns "true" if the string contains only the following whitespace characters: tabs, newlines, and spaces; return "false" otherwise. Same as strIsnt(). Opposite of is(). |
String | lastIndexOf(to_find) | Integer | Returns the index within this string of the last occurrence of the specified string, returns -1 if not found. This method is case sensitive, to ignore case use the other lastIndexOf() method and set the ignore case flag. Also equivalent to AmiScript method strLastIndexOf(). |
String | lastIndexOf(to_find, last, ignore_case) | Integer | Returns the index within this string of the last occurrence of the specified string by searching from the specified index backwards. Returns -1 if not found. Same as AmiScript method strLastIndexOf(), with a suppliable ignore case flag. |
String | length() | Integer | Returns the length of this string. Same as AmiScript method strLen(). |
String | replaceAll(to_replace, replacement) | String | Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence. Same as AmiScript method strReplace(). |
String | splice(start, charsToReplace, replacement) | String | Replaces a base string's subsequence of chars with a replacement string. If start or charsToReplace extend beyond string limits, they will be set to string limits. Same as strSplice(). |
String | split(delimiter) | List | Returns a list of strings, split by the given delimiter. |
String | splitLines() | List | Splits lines and returns a list of lines separated by line feed and line return chars. |
String | startsWith(s, ignore_case) | Boolean | Tests if this string starts with the specified prefix. Same as AmiScript strStartsWith(). |
String | startsWith(s, start, ignore_case) | Boolean | Tests if this string starts with the specified prefix, starting from the given index. |
String | strip(prefix, suffix) | String | Same as AmiScript method strStrip(). Returns the substring of supplied text with the prefix and suffix removed. If the string doesn't start with the specified prefix, then the prefix is ignored. If the string doesn't end with suffix, then the suffix is ignored. |
String | substring(begin) | String | Returns a string that is a substring of this string, starting from the specified index to the end of the string. |
String | substring(begin, end) | String | Returns a string that is a substring of this string, start and end at specific index. Same as AmiScript strSubstring(). |
Object | toJson() | String | Returns a string of a json representation of this object. |
String | toLower() | String | Converts all of the characters in this String to lower case using the rules of the default locale. Same as AmiScript strLower(). |
String | toUpper() | String | Converts all of the characters in this String to upper case using the rules of the default locale. Same as AmiScript strUpper(). |
String | trim() | String | Returns a string whose value is this string, with any leading and trailing whitespace removed. Same as strTrim(). |
Method Definitions¶
constructor(s)¶
String string = new String(String s)
Description¶
Initialize a string object
Parameter Definition¶
Name | Type | Description |
---|---|---|
s | String | a String |
Example 1¶
after(toFind,origIfNotFound)¶
String String::after(String toFind, Boolean origIfNotFound)
Description¶
Get the portion of a string after the first occurence of a delimiter. If the delimiter is not found, then return either the original string or null depending on origIfNotFound param. Same as AmiScript strAfter().
Parameter Definition¶
Name | Type | Description |
---|---|---|
toFind | String | The substring to find |
origIfNotFound | Boolean | If the toFind parameter doesn't exist in the text, then return text if true or null if false. |
Example 1¶
afterLast(toFind,origIfNotFound)¶
String String::afterLast(String toFind, Boolean origIfNotFound)
Description¶
Get the portion of a string after the last occurence of a delimiter. If the delimiter is not found, then return either the original string or null depending on origIfNotFound param. Same as AmiScript strAfterLast().
Parameter Definition¶
Name | Type | Description |
---|---|---|
toFind | String | The substring to find |
origIfNotFound | Boolean | If the toFind parameter doesn't exist in the text, then return text if true or null if false. |
Example 1¶
before(toFind,origIfNotFound)¶
String String::before(String toFind, Boolean origIfNotFound)
Description¶
Get the portion of a string before the first occurence of a delimiter. If the delimiter is not found, then return either the original string or null depending on origIfNotFound param. Same as AmiScript strBefore().
Parameter Definition¶
Name | Type | Description |
---|---|---|
toFind | String | The substring to delimit after |
origIfNotFound | Boolean | If the toFind parameter doesn't exist in the text, then return text if true or null if false. |
Example 1¶
beforeLast(toFind,origIfNotFound)¶
String String::beforeLast(String toFind, Boolean origIfNotFound)
Description¶
Get the portion of a string before the last occurrence of a delimiter. If the delimiter is not found, then return either the original string or null depending on origIfNotFound param.
Parameter Definition¶
Name | Type | Description |
---|---|---|
toFind | String | The substring to delimit before |
origIfNotFound | Boolean | If the toFind parameter doesn't exist in the supplied string, then return the full string if true or null if false. |
Example 1¶
charAt(index)¶
Character String::charAt(Integer index)
Description¶
Returns the character at the specified index. Equivalent to the AmiScript method strChartAt().
Parameter Definition¶
Name | Type | Description |
---|---|---|
index | Integer | Location of the character |
Example 1¶
chars()¶
Description¶
Returns a list whose length is the length of this string and whose contents are initialized to contain the character sequence represented by this string.
Example 1¶
cut(delim,fieldList)¶
String String::cut(String delim, String fieldList)
Description¶
Splits string using the supplied delimiter based on the supplied field positions. The string returned is the resulting strings or characters at the field positions joined by the delimiter. Same as AmiScript method strCut().
Parameter Definition¶
Name | Type | Description |
---|---|---|
delim | String | delimiter, literal not a pattern. |
fieldList | String | fields to return within a range n-m. Use n,m... for individual fields, or -n for number of fields up to and including that index, or n- for fields including and after that index. |
Example 1¶
decodeToByte()¶
Description¶
Decodes a string into a byte. Must be a number without any suffix.
Example 1¶
decodeToLong()¶
Description¶
Decodes a string into a long. Must be a number without any suffix.
Example 1¶
decodeToShort()¶
Description¶
Decodes a string into a short. Must be a number without any suffix.
Example 1¶
endsWith(suffix,ignore_case)¶
Boolean String::endsWith(String suffix, Boolean ignore_case)
Description¶
Returns "true" if this string ends with the specified suffix, "false" otherwise. Same as AmiScript method strEndsWith().
Parameter Definition¶
Name | Type | Description |
---|---|---|
suffix | String | string to test |
ignore_case | Boolean | to ignore case set to "true", "false" otherwise. |
Example 1¶
getClassName()¶
Description¶
Returns the string name of this object's class type.
Example 16¶
indexOf(to_find)¶
Integer String::indexOf(String to_find)
Description¶
Returns the index within this string of the first occurrence of the specified string, returns -1 if no such occurrence is found. Same as AmiScript method strIndexOf() with one argument.
Parameter Definition¶
Name | Type | Description |
---|---|---|
to_find | String | string to find |
Example 1¶
indexOf(to_find,start_index)¶
Integer String::indexOf(String to_find, Integer start_index)
Description¶
Returns the index within this string of the first occurrence of the specified string, starting from a specific index, returns -1 if no such occurrence is found. Same as AmiScript method strIndexOf() with two arguments.
Parameter Definition¶
Name | Type | Description |
---|---|---|
to_find | String | string to find |
start_index | Integer | index to begin |
Example 1¶
is()¶
Description¶
Returns "true" if the string contains characters other than whitespace characters, such as tabs, newlines, and spaces; returns "false" otherwise. Same as strIs(). Opposite of isnt().
Example 1¶
Example 2¶
isEmpty()¶
Description¶
Returns "true" if, and only if, length() is 0 (i.e, an empty string).
Example 1¶
isnt()¶
Description¶
Returns "true" if the string contains only the following whitespace characters: tabs, newlines, and spaces; return "false" otherwise. Same as strIsnt(). Opposite of is().
Example 1¶
Example 2¶
lastIndexOf(to_find)¶
Integer String::lastIndexOf(String to_find)
Description¶
Returns the index within this string of the last occurrence of the specified string, returns -1 if not found. This method is case sensitive, to ignore case use the other lastIndexOf() method and set the ignore case flag. Also equivalent to AmiScript method strLastIndexOf().
Parameter Definition¶
Name | Type | Description |
---|---|---|
to_find | String | string to find |
Example 1¶
lastIndexOf(to_find,last,ignore_case)¶
Integer String::lastIndexOf(String to_find, Integer last, Boolean ignore_case)
Description¶
Returns the index within this string of the last occurrence of the specified string by searching from the specified index backwards. Returns -1 if not found. Same as AmiScript method strLastIndexOf(), with a suppliable ignore case flag.
Parameter Definition¶
Name | Type | Description |
---|---|---|
to_find | String | string to find |
last | Integer | index to begin |
ignore_case | Boolean | "true" if ignore case, "false" otherwise. |
Example 1¶
length()¶
Description¶
Returns the length of this string. Same as AmiScript method strLen().
Example 1¶
replaceAll(to_replace,replacement)¶
String String::replaceAll(String to_replace, String replacement)
Description¶
Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence. Same as AmiScript method strReplace().
Parameter Definition¶
Name | Type | Description |
---|---|---|
to_replace | String | string to find |
replacement | String | string replacement |
Example 1¶
splice(start,charsToReplace,replacement)¶
String String::splice(Number start, Number charsToReplace, String replacement)
Description¶
Replaces a base string's subsequence of chars with a replacement string. If start or charsToReplace extend beyond string limits, they will be set to string limits. Same as strSplice().
Parameter Definition¶
Name | Type | Description |
---|---|---|
start | Number | zero indexed start of replacement. |
charsToReplace | Number | length of chars to replace. |
replacement | String | text to replace specified subsequence with, null is treated as empty string. |
Example 1¶
Example 2¶
Example 3¶
split(delimiter)¶
List String::split(String delimiter)
Description¶
Returns a list of strings, split by the given delimiter.
Parameter Definition¶
Name | Type | Description |
---|---|---|
delimiter | String | delimiter to split by |
Example 1¶
splitLines()¶
Description¶
Splits lines and returns a list of lines separated by line feed and line return chars.
Example 1¶
startsWith(s,ignore_case)¶
Boolean String::startsWith(String s, Boolean ignore_case)
Description¶
Tests if this string starts with the specified prefix. Same as AmiScript strStartsWith().
Parameter Definition¶
Name | Type | Description |
---|---|---|
s | String | string to find |
ignore_case | Boolean | "true" to ignore case, "false" otherwise |
Example 1¶
startsWith(s,start,ignore_case)¶
Boolean String::startsWith(String s, Integer start, Boolean ignore_case)
Description¶
Tests if this string starts with the specified prefix, starting from the given index.
Parameter Definition¶
Name | Type | Description |
---|---|---|
s | String | string to find |
start | Integer | index to start |
ignore_case | Boolean | "true" to ignore case, "false" otheriwse |
Example 1¶
strip(prefix,suffix)¶
String String::strip(String prefix, String suffix)
Description¶
Same as AmiScript method strStrip(). Returns the substring of supplied text with the prefix and suffix removed. If the string doesn't start with the specified prefix, then the prefix is ignored. If the string doesn't end with suffix, then the suffix is ignored.
Parameter Definition¶
Name | Type | Description |
---|---|---|
prefix | String | The prefix to strip |
suffix | String | The suffix to strip |
Example 1¶
substring(begin)¶
String String::substring(Integer begin)
Description¶
Returns a string that is a substring of this string, starting from the specified index to the end of the string.
Parameter Definition¶
Name | Type | Description |
---|---|---|
begin | Integer | index to begin |
Example 1¶
substring(begin,end)¶
String String::substring(Integer begin, Integer end)
Description¶
Returns a string that is a substring of this string, start and end at specific index. Same as AmiScript strSubstring().
Parameter Definition¶
Name | Type | Description |
---|---|---|
begin | Integer | index to begin |
end | Integer | index to end |
Example 1¶
toJson()¶
Description¶
Returns a string of a json representation of this object.
Example 16¶
toLower()¶
Description¶
Converts all of the characters in this String to lower case using the rules of the default locale. Same as AmiScript strLower().
Example 1¶
toUpper()¶
Description¶
Converts all of the characters in this String to upper case using the rules of the default locale. Same as AmiScript strUpper().
Example 1¶
trim()¶
Description¶
Returns a string whose value is this string, with any leading and trailing whitespace removed. Same as strTrim().