Replace the first substring of this string which matches with the given regular expression with the given replacement.

1 string.replaceFirst

<string.replaceFirst>
    <text /> !
    <regexp /> !
    <word /> !
</string.replaceFirst>

Exceptions

requires 3 arguments, received: ...

The 3 entry parameters has not been specified.

Example

Replace the first substring of characters 'to STRING' by 'SET'.

Copy
<xsql-script name='string_replaceFirst'>
    <body>
        <set name='text'>This IS a STRING OF characters next to another STRING OF characters</set>
        <set name='regexp'>to STRING</set>
        <set name='word'>SET</set>
        <println>
         <string.replaceFirst>
             <text />
             <regexp />
             <word />
         </string.replaceFirst>
        </println>
    </body>
</xsql-script>

Returns:

Copy
This IS a SET OF characters next to another STRING OF characters