Returns the byte of the indicated position.

1 string.byteAt

<string.byteAt>
    <text /> !
    <position /> !
</string.byteAt>

Exceptions

requires 2 arguments, received: ...

The 2 entry parameters has not been specified.

java.lang.String index out of range: ...

The position indicated is out rank or is negative or is greater than the lenght of the text.

invalid number ...

The position indicated is not a number.

Example

String contained in variable and position expressed through integer.

Copy
<xsql-script name='byteAt_sample1'>
    <body>
        <set name='word'>hola</set>
        <println><string.charAt><word/>0</string.charAt></println>
    </body>
</xsql-script>

Returns the byte of the string contained in the variable word, which is found in the position indicated with the constant value 0.

Copy
h
Example

String contained in variable and position expressed through variable.

Copy
<xsql-script name='byteAt_sample2'>
   <body>
       <set name='word'>hola</set>
       <set name='position'>3</set>
       <println><string.charAt><word/><position/></string.charAt></println>
   </body>
</xsql-script>

Returns the byte of the string contained in the variable word, which is found in the position contained in the variable position.

Copy
a