student-ar-org-ascollada-utils-StringUtil.ax [swf] flex
The @ax-student-ar-org-ascollada-utils-StringUtil utility class is an all-static class with methods for working with String objects within Flex. You do not create instances of @ax-student-ar-org-ascollada-utils-StringUtil; instead you call methods such as the <code>@ax-student-ar-org-ascollada-utils-StringUtil.substitute()</code> method.
Removes all whitespace characters from the beginning and end of the specified string.
parameter: str The String whose whitespace should be trimmed.
returns: Updated String where whitespace was removed from the beginning and end.
Removes all whitespace characters from the beginning and end of each element in an Array, where the Array is stored as a String.
parameter: value The String whose whitespace should be trimmed.
parameter: separator The String that delimits each Array element in the string.
returns: Updated String where whitespace was removed from the beginning and end of each element.
Returns <code>true</code> if the specified string is a single space, tab, carriage return, newline, or formfeed character.
parameter: str The String that is is being queried.
returns:true
if the specified string is a single space, tab, carriage return, newline, or formfeed character.
Substitutes "{n}" tokens within the specified string with the respective arguments passed in.
parameter: str The string to make substitutions in. This string can contain special tokens of the form <code>{n}</code>, where <code>n</code> is a zero based index, that will be replaced with the additional parameters found at that index if specified.
parameter: rest Additional parameters that can be substituted in the <code>str</code> parameter at each <code>{n}</code> location, where <code>n</code> is an integer (zero based) index value into the array of values specified. If the first parameter is an array this array will be used as a parameter list. This allows reuse of this routine in other methods that want to use the ... rest signature. For example <pre> public function myTracer(str:String, ... rest):void { label.text += @ax-student-ar-org-ascollada-utils-StringUtil.substitute(str, rest) + "\n"; } </pre>
returns: New string with all of the{n}
tokens replaced with the respective arguments specified. @example var str:String = "here is some info '{0}' and {1}"; trace(@ax-student-ar-org-ascollada-utils-StringUtil.substitute(str, 15.4, true)); // this will output the following string: // "here is some info '15.4' and true"
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.