Returns the value of the char in the specified index.
The index varies of 0 to the lenght () - 1.
The first value of the character sequence is in the index0, the following is in the index1 and so on like an array index.
1 string.charAt
<string.charAt>
<text /> !
<position /> !
</string.charAt>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Etext | string | ||||
Eposition | integer |
Returns | |
---|---|
Type | Description |
string | Returns the value of the character in the specified index of the string. The first char value is in the index 0. |
Exceptions
requires 2 arguments, received: ...
The 2 entry parameters has not been specified.
java.lang.String index out of range: ...
The indicated position is out rank or is negative or is greater than the lenght of the text.
invalid number ...
The indicated position is not a number.
String contained in variable and position expressed through integer.
<xsql-script name='charAt_sample1'> <body> <set name='word'>hello</set> <println><string.charAt><word/>0</string.charAt></println> </body> </xsql-script>
Returns the character of the string contained in the cariable word, which is found in the indicated position with the constant value 0.
h
String contained in variable and position expressed through variable.
<xsql-script name='charAt_sample2'> <body> <set name='word'>hello</set> <set name='position'>3</set> <println><string.charAt><word/><position/></string.charAt></println> </body> </xsql-script>
Returns the character of the string contained in the variable word, which is found in the position contained in the variable position.
l