Inheritance diagram for String:
This is the DAZ Script counterpart of the QString type used in the DAZ Studio SDK.
A String is a sequence of zero or more Unicode characters. All string indexes are zero-based, which means the index for the last character in the string str
is always str.length - 1
.
var str1 = "foo"; var str2 = new String( "foo" ); var str3 = str1 + " " + str2; var str4 = String( "%1%2" ).arg( "foo" ).arg( "bar" );
String::String | ( | ) |
Default constructor.
String::String | ( | String | text | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
text | - The initial value of the string |
value | - The Number to represent as a string. | |
fieldWidth | - Specifies the minimum amount of space that value is padded to. A positive fieldWidth will produce right aligned text, a negative fieldWidth will produce left aligned text. |
value
.
value | - The text to represent as a string. | |
fieldWidth | - Specifies the minimum amount of space that value is padded to. A positive fieldWidth will produce right aligned text, a negative fieldWidth will produce left aligned text. |
value
. String String::argDec | ( | Number | value, | |
Number | fieldWidth = 0 , |
|||
Number | format = 'g' , |
|||
Number | precision | |||
) |
Specialized for cases where value
is a decimal.
value | - The Number to represent as a string. | |
fieldWidth | - Specifies the minimum amount of space that value is padded to. A positive fieldWidth will produce right aligned text, a negative fieldWidth will produce left aligned text. | |
format | - The format to use:
| |
precision | - With 'e', 'E' and 'f', this is the numbers of digits after the decimal point. With 'g' and 'G', this is the maximum number of significant digits. |
value
.var fValue = Math.PI; var sValue = String( "%1" ).argDec( fValue, 0, 'f', 5 ); MessageBox.information( String( "Variable : sValue\nType : %1\nValue : %2" ).arg( typeof sValue ).arg( sValue ), "String.argDec(...)", "&OK" );
Specialized for cases where value
is an integer.
value | - The Number to represent as a string. | |
fieldWidth | - Specifies the minimum amount of space that value is padded to. A positive fieldWidth will produce right aligned text, a negative fieldWidth will produce left aligned text. | |
base | - The base, which must be between 2 and 36 |
value
.var nValue = 32; var sValue = String( "%1" ).argInt( nValue, 0, 10 ); MessageBox.information( String( "Variable : sValue\nType : %1\nValue : %2" ).arg( typeof sValue ).arg( sValue ), "String.argInt(...)", "&OK" );
pos | The index position to retrieve the character from. |
pos
. If pos
is out of bounds, undefined
is returned.
pos | The index position of the character to retrieve the code for. |
pos
. If pos
is out of bounds, undefined
is returned. String String::concat | ( | string1 | [,...] | ) |
string1 | The first string to concatenate. |
pattern | The pattern to search the string for |
pattern
, returns true. Otherwise returns false.
pattern | The pattern to search the string for |
pattern
, returns true. Otherwise returns false.
pattern | The pattern to search the string for | |
startPos | The [zero-based] index to begin the search at. |
pattern
in the string, starting at position startPos
. If startPos
is not specified, the function starts at the beginning of the string. If the pattern
is not found in the string, -1
is returned.
pattern | The pattern to search the string for | |
startPos | The [zero-based] index to begin the search at. |
pattern
in the string, starting at position startPos
. If startPos
is not specified, the function starts at the beginning of the string. If the pattern
is not found in the string, -1
is returned.
pattern | The pattern to search the string for | |
startPos | The [zero-based] index to begin the search at. |
pattern
in the string, starting at position startPos
. If startPos
is not specified, the function starts at the end of the string. If the pattern
is not found in the string, -1
is returned.
pattern | The pattern to search the string for | |
startPos | The [zero-based] index to begin the search at. |
pattern
in the string, starting at position startPos
. If startPos
is not specified, the function starts at the end of the string. If the pattern
is not found in the string, -1
is returned.
charCode1 | The first character of the string |
pattern | The pattern to search the string for | |
startPos | The [zero-based] index to begin the search at. |
pattern
in the string, starting at position startPos
. If startPos
is not specified, the function starts at the beginning of the string. If the pattern
is not found in the string, -1
is returned.
pattern | The pattern to search the string for | |
startPos | The [zero-based] index to begin the search at. |
pattern
in the string, starting at position startPos
. If startPos
is not specified, the function starts at the beginning of the string. If the pattern
is not found in the string, -1
is returned. Boolean String::isEmpty | ( | ) |
pattern | The pattern to search the string for | |
startPos | The [zero-based] index to begin the search at. |
pattern
in the string, starting at position startPos
. If startPos
is not specified, the function starts at the end of the string. If the pattern
is not found in the string, -1
is returned.
pattern | The pattern to search the string for | |
startPos | The [zero-based] index to begin the search at. |
pattern
in the string, starting at position startPos
. If startPos
is not specified, the function starts at the end of the string. If the pattern
is not found in the string, -1
is returned.
num | The number of characters to copy from the beginning of the string |
num
leftmost characters. Performs a locale-sensitive comparison of the given string with this string.
that | The string to compare this string to. |
String String::lower | ( | ) |
pattern | The pattern to search the string for |
pattern
in the string. If the pattern
is not found in the string, undefined
is returned.
startIndex | The index of the first character to copy from the string | |
num | The number of characters to copy from the string |
startIndex
including num
characters.
pattern | The pattern to search the string for | |
newValue | The new string to replace matches with |
pattern
in the string with newValue
if pattern
is found in the string.
num | The number of characters to copy from the end of the string |
num
rightmost characters.
pattern | The pattern to search the string for |
pattern
in the string, starting at the beginning of the string. If the pattern
is not found in the string, -1
is returned.
pattern | The pattern to search the string for |
pattern
in the string, starting at the beginning of the string. If the pattern
is not found in the string, -1
is returned.
pattern | The pattern to search the string for |
pattern
in the string, starting at the end of the string. If the pattern
is not found in the string, -1
is returned.
pattern | The pattern to search the string for |
pattern
in the string, starting at the end of the string. If the pattern
is not found in the string, -1
is returned.
Creates a substring from this string, starting with the character at index start
, and going to, but not including the character at index end
.
start | The index of the first character in the string to include in the substring. If negative, it will be treated as this.length + start. | |
end | The index of the character at the end of the substring, this character will not be included in the substring. If undefined, the substring will include all characters from start to the end of this string. If negative, it will be treated as this.length + end. |
pattern | The pattern to search the string for |
pattern
.
pattern | The pattern to search the string for |
pattern
.
Splits this string into an array of substrings at each occurrence of separator
.
separator | A regular expression containing the separator that will be searched for. If an empty expression is given, the result will contain one entry for each character in this string. If undefined is given the result will contain one entry containing the whole string. | |
limit | If the resulting array contains more entries than limit, it will be truncated to contain limit entries. |
Splits this string into an array of substrings at each occurrence of separator
.
separator | A regular expression containing the separator that will be searched for. If an empty expression is given, the result will contain one entry for each character in this string. If undefined is given the result will contain one entry containing the whole string. |
Splits this string into an array of substrings at each occurrence of separator
.
separator | A string containing the separator that will be searched for. If an empty string is given, the result will contain one entry for each character in this string. If undefined is given the result will contain one entry containing the whole string. | |
limit | If the resulting array contains more entries than limit, it will be truncated to contain limit entries. |
Splits this string into an array of substrings at each occurrence of separator
.
separator | A string containing the separator that will be searched for. If an empty string is given, the result will contain one entry for each character in this string. If undefined is given the result will contain one entry containing the whole string. |
pattern | The pattern to search the string for |
pattern
, returns true. Otherwise returns false.
pattern | The pattern to search the string for |
pattern
, returns true. Otherwise returns false.
startIndex | The index of the first character to copy to the substring | |
num | The number of characters to copy into the substring |
startIndex
including num
characters. String String::toLocaleLowerCase | ( | ) |
Provides a locale-aware version of String::toLowerCase().
String String::toLocaleUpperCase | ( | ) |
Provides a locale-aware version of String::toUpperCase().
String String::toLowerCase | ( | ) |
String String::toUpperCase | ( | ) |
String String::upper | ( | ) |
The length of the string.