mx.utils

# RPCStringUtil - AS3 Flex

Package | mx.utils
Class | public class RPCStringUtil
Inheritance | RPCStringUtil Object

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The RPCStringUtil class is a subset of StringUtil, removing methods that create dependency issues when RPC messages are in a bootstrap loader.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | isWhitespace(character:String):Boolean [static] Returns true if the specified string is a single space, tab, carriage return, newline, or formfeed character. | RPCStringUtil
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | substitute(str:String, ... rest):String [static] Substitutes "{n}" tokens within the specified string with the respective arguments passed in. | RPCStringUtil
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | trim(str:String):String [static] Removes all whitespace characters from the beginning and end of the specified string. | RPCStringUtil
|  | trimArrayElements(value:String, delimiter:String):String [static] Removes all whitespace characters from the beginning and end of each element in an Array, where the Array is stored as a String. | RPCStringUtil
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Method Detail

### isWhitespace

()
method

`public static function isWhitespace(character:String):Boolean`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Returns `true` if the specified string is a single space, tab, carriage return, newline, or formfeed character.

Parameters

| `character:String` — The String that is is being queried.

Returns

| `Boolean` — `true` if the specified string is a single space, tab, carriage return, newline, or formfeed character.

### substitute

()
method

`public static function substitute(str:String, ... rest):String`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Substitutes "{n}" tokens within the specified string with the respective arguments passed in.

Parameters

| `str:String` — The string to make substitutions in. This string can contain special tokens of the form `{n}`, where `n` is a zero based index, that will be replaced with the additional parameters found at that index if specified.
| `... rest` — Additional parameters that can be substituted in the `str` parameter at each `{n}` location, where `n` 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
             public function myTracer(str:String, ... rest):void
             {
                 label.text += StringUtil.substitute(str, rest) + "\n";
             }

Returns

| `String` — New string with all of the `{n}` tokens replaced with the respective arguments specified.

### trim

()
method

`public static function trim(str:String):String`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Removes all whitespace characters from the beginning and end of the specified string.

Parameters

| `str:String` — The String whose whitespace should be trimmed.

Returns

| `String` — Updated String where whitespace was removed from the beginning and end.

### trimArrayElements

()
method

`public static function trimArrayElements(value:String, delimiter:String):String`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Removes all whitespace characters from the beginning and end of each element in an Array, where the Array is stored as a String.

Parameters

| `value:String` — The String whose whitespace should be trimmed.
| `delimiter:String` — The String that delimits each Array element in the string.

Returns

| `String` — Updated String where whitespace was removed from the beginning and end of each element.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00