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
SUBSTITUTE
tag substitutes all occurrences of the specified substring within a string. The substring comparison is case-sensitive. For more information about variables, see the CS Developer's Guide.errno
The value of
errno
is unchanged.Example
This example replaces all occurrences of the string
test
within the stringbar
.
<SETVAR
NAME="bar" VALUE="This is a test of a test."/> Bar is: <CSVAR
NAME="Variables.bar"/> <br/> <SUBSTITUTE STR="Variables.bar" OUTSTR="foo" WHAT="test" WITH="none"/> And foo is: <CSVAR
NAME="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 > ![]()
FatWire XML Tag Reference
Copyright 2005,2006,2007 by FatWire Software
All rights reserved.