This section explains the functions that handle strings.
The rtrim() function returns a string from which the following consecutive characters at the end of a string specified in an item reference have been removed:
Single-byte space (' ')
Horizontal tab (HT)
Line feed (LF)
Carriage return (CR)
The rtrim() function format is as follows:
See
Refer to "2.4.9 Item References" for details
If the conversion has operated normally, a string type is returned.
Example
If $name is "Smith Adam " (where " " is a single-byte space):
rtrim($name)
"Smith Adam" is output as a string.
The string() function converts an item reference value to a standard format string.
The string() function format is as follows:
See
Refer to "2.4.9 Item References" for details.
If the conversion has operated normally, a string type is returned. If the item reference value is "null", "null" is returned.
The string after conversion is in the following format:
Type specified in argument | String after conversion |
---|---|
String type | Not converted |
Numeric type | Integer part + decimal part (*1) |
*1: The integer part and decimal part are a maximum of 18 digits each.
Example
If the numeric item $age is "30":
string($age)
"30" is output as the string.