The StringUtil utility class is an all-static class with methods for
working with String objects within Flex.
You do not create instances of StringUtil;
instead you call methods such as
the StringUtil.substitute()
method.
Static methods
staticsubstitute(str:String, rest:Rest<String>):String
Substitutes "{n}" tokens within the specified string with the respective arguments passed in.
var str:String = "here is some info '{0}' and {1}";
trace(StringUtil.substitute(str, 15.4, true));
// this will output the following string:
// "here is some info '15.4' and true"
Note that this uses String.replace and "$" can have special meaning in the argument strings escape by using "$$".
Parameters:
str | The string to make substitutions in.
This string can contain special tokens of the form
|
---|---|
rest | Additional parameters that can be substituted
in the
|
Returns:
New string with all of the {n}
tokens
replaced with the respective arguments specified.