Home > Contents > Index >
SUBSTRING
Constructs a new variable that contains a substring.
Syntax
<SUBSTRING STR="string value" OUTSTR="outstring name" [INDEX="OFFSET"] [ENDINDEX="END_OFFSET"]/>Parameters
STR (required)- String containing substring.
OUTSTR (required)- Name of variable to contain substring.
INDEX (optional)- Beginning offset in
STR. The default for this parameter is0.
ENDINDEX (optional)- Ending offset in
STR. The default for this parameter is the length ofSTR.
Description
The
SUBSTRINGtag constructs a new variable containing a substring. For more information about variables, Sites Developer's Guide.Error Numbers
The possible values of
errnoinclude:
Value Description -50 Bad start index. -51 Bad end index. -52 Empty output string.Example
This example places the value "This is a test" in
NewString. The value of the variableNewStringistestafter this tag executes. An error is set if either of the supplied index values is out of range.
<SETVAR NAME="errno" VALUE="0"/> <SUBSTRING STR="This is a test" OUTSTR="NewString" INDEX="10" ENDINDEX="14"/> <IF COND="IsError.Variables.errno=true"> <THEN> <!--Handle error--> </THEN> </IF>See Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.