Home > Contents > Index >
SUBSTITUTE
Substitutes all occurrences of the specified substring within a string.
Syntax
<SUBSTITUTE STR="STRING_NAME" WHAT="WHAT_STRING" [WITH ="REPLACE_STRING"] OUTSTR="OUTSTR_NAME"/>Parameters
STR (required)- String that contains substring to substitute.
WHAT (required)- Substring to replace within
STRING_NAME. This parameter can contain escapable characters, such as %20 for a space. For example, to remove all spaces and replace them with blanks, useWHAT="%20" WITH="".
WITH (optional)- Replacement value of the substring. This parameter can contain escapable characters, such as %20 for a space. For example, to remove all spaces and replace them with blanks, use
WHAT="%20" WITH="".
OUTSTR (required)- Resulting string after substitution.
Description
The
SUBSTITUTEtag substitutes all occurrences of the specified substring within a string. The substring comparison is case-sensitive. For more information about variables, see the Sites Developer's Guide.Error Numbers
There are no possible
errnofor this tag.Example
This example replaces all occurrences of the string
testwithin the stringbar.
<SETVARNAME="bar" VALUE="This is a test of a test."/> Bar is: <CSVARNAME="Variables.bar"/> <br/> <SUBSTITUTE STR="Variables.bar" OUTSTR="foo" WHAT="test" WITH="none"/> And foo is: <CSVARNAME="Variables.foo"/>The browser displays:
Bar is: This is a test of a test. And foo is: This is none of a none.See Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.