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>

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.

Example

String contained in variable and position expressed through integer.

Copy
<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.

Copy
h
Example

String contained in variable and position expressed through variable.

Copy
<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.

Copy
a