The String Class
The String class provides methods for working with text.
Methods
Name | Description |
---|---|
|
Returns the character at the specified index in the current String. |
|
Returns TRUE if s is contained within the current String; otherwise FALSE. |
|
Returns TRUE if the current String ends with s; otherwise FALSE. |
|
Returns TRUE if s matches the current String; otherwise FALSE. |
|
Returns TRUE if s matches the current String, ignoring character case; otherwise FALSE. |
|
Sets the format of the page number string for a PAGENOBOX. |
|
Returns the index of a substring within the current String. |
|
Returns TRUE if the current string has a length of zero
(length()=0 ); otherwise FALSE. |
|
Returns TRUE if the current string has a length of zero
(length()=0 ) and the string is tagged as null; otherwise FALSE.
This is the case for null valued input variables read from the input
stream. |
|
Returns the index of s within the current String of the last occurrence of s, searching backward. |
|
Returns the length of the current String |
|
Returns TRUE if the current string matches the regular expression s; otherwise FALSE. |
|
Replaces old in the current String with new. |
|
Replaces every occurrence of old in the current String with new. |
|
Replaces the first occurrence of old in the current String with new. |
|
Returns TRUE if the current String starts with s; otherwise FALSE. |
|
Returns the substring starting at byte position startindex and ending at endindex-1 or the end of the string. |
|
Converts the current String to lowercase. |
|
Converts the current String value to a Numeric. |
|
Converts the current value of any object to a String. |
|
Converts the current String to uppercase. |
|
Uses the current String as the key for a lookup in Genero localization files; returns any entry found, otherwise returns the current String itself. |
|
Removes whitespace characters from the beginning and end of the current String. |
|
Removes whitespace characters from the beginning and end of the current String, as well as any contained whitespace. |
|
Removes whitespace characters from the beginning of the current String. |
|
Removes whitespace characters from the end of the current String. |
|
Returns a URL encoding of the current String |
Usage
With RTL classes, it is not possible to create and subclass objects. The
new
keyword is not supported.
All literal String values in an expression must be delimited by double quotes.
All the methods require an object instance. When you invoke the method, it is prefixed with the object instance name and the "." character. You can get an object instance by referencing a FGL variable or by calling a method on another object. The object can be a literal value, for example:
"Test".length()
When specifying the character position (index) of a string, the first character value is at position 0.
Concatenating Strings
Use the + operator to concatenate strings. For example:
("Total:"+" "+order_line.totalorderprice).toString()
This expression returns the current value of totalorderprice
as part of a String
value:
Total: 12.95