Apache Flex (FlexJS) 0.7.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
StringTrimmer

Package | org.apache.flex.utils
Class | public class StringTrimmer
Inheritance | StringTrimmer Object

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The StringTrimmer class is a collection of static functions that provide utility features for trimming whitespace off Strings.

Public Methods

| Method | Defined By
--- | --- | ---
|  | isWhitespace(character:String):Boolean [static] Returns true if the specified string is a single space, tab, carriage return, newline, or formfeed character. | StringTrimmer
|  | splitAndTrim(value:String, delimiter:String):Array [static] Removes all whitespace characters from the beginning and end of each element in an Array, where the Array is stored as a String. | StringTrimmer
|  | trim(str:String):String [static] Removes all whitespace characters from the beginning and end of the specified string. | StringTrimmer
|  | 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. | StringTrimmer

Method Detail

isWhitespace | () | method

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

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

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.

splitAndTrim | () | method |

`public static function splitAndTrim(value:String, delimiter:String):Array`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

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

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

trim | () | method |

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

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

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 : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

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.

Mon Sep 5 2016, 07:19 AM -07:00