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 CS Developer's Guide.errno
The value of
errnois unchanged.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 > ![]()
FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.