Create a string with the value contained.
1 string
<string
mode='mode'
trim='trim'
>
<value /> +
</string>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Amode | string | Unquoted to avoid the quotation marks when this string is used in a query or in a function. | |||
Atrim | boolean | True to remove the the blank spaces which exist to the beginning and/or at the end of the character string. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Evalue | string |
Returns | |
---|---|
Type | Description |
string | Character string. |
Remarks
By default a character string is returned conserving the spaces which are in front of and/or behind this string. If you want to omit this spaces, you should indicate with the attribute trim with the value true.
Warning
The multiple operations of concatenation in a same string, can derivate in memory fragmentation and slow operations. If you need to perform massive operations of concatenation you should use <stringBuffer.
Copy
<stringBuffer name='buf'><string /></stringBuffer> <for name='x' start='1' end='10000'> <do> <stringBuffer.append name='buf'><string>1234567890</string></stringBuffer.append> </do> </for>
Example
Show on screen a character string.
Copy
<xsql-script name='string_sample'> <body> <set name='a'>STR1</set> <set name='b'> <string trim='true'> This is a string <a/> keeping the spaces. </string> </set> <println><b/></println> </body> </xsql-script>
The content of a string type variable is shown on screen. This variable contains two character strings and another variable of String type concatenated.
Copy
This is a stringSTR1 keeping the spaces.