Adobe® Flex® 4 Language Reference
Show Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
flashx.textLayout.utils 
CharacterUtil 
Packageflashx.textLayout.utils
Classpublic final class CharacterUtil
InheritanceCharacterUtil Inheritance Object

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Utilities for managing and getting information about characters. The methods of this class are static and must be called using the syntax CharacterUtil.method(parameter).



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
 Inherited
Indicates whether an object has a specified property defined.
Object
  
[static] Returns true if the charCode argument is a high word in a surrogate pair.
CharacterUtil
  
[static] Returns true if the charCode argument is a low word in a surrogate pair.
CharacterUtil
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
[static] Returns true if charCode is a whitespace character.
CharacterUtil
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Method Detail

isHighSurrogate

()method
public static function isHighSurrogate(charCode:int):Boolean

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns true if the charCode argument is a high word in a surrogate pair. A surrogate pair represents a character with a code point that requires more than sixteen bits to express and thus requires a combination of two 16-bit words, a high surrogate and a low surrogate, to embody its code point.

This method can be used when processing a series of characters to ensure that you do not inadvertently divide a surrogate pair into incomplete halves.

Parameters

charCode:int — An integer that represents a character code. Character codes are usually represented in hexadecimal format. For example, the space character's character code can be represented by the number 0x0020.

Returns
Booleantrue if charCode is the high surrogate in a surrogate pair.

isLowSurrogate

()method 
public static function isLowSurrogate(charCode:int):Boolean

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns true if the charCode argument is a low word in a surrogate pair. A surrogate pair represents a character with a code point that requires more than sixteen bits to express and thus requires a combination of two 16-bit words, a high surrogate and a low surrogate, to embody its code point.

This method can be used when processing a series of characters to ensure that you do not inadvertently divide a surrogate pair into incomplete halves.

Parameters

charCode:int — An integer that represents a character code. Character codes are usually represented in hexadecimal format. For example, the space character's character code can be represented by the number 0x0020.

Returns
Booleantrue if charCode is the low surrogate in a surrogate pair.

isWhitespace

()method 
public static function isWhitespace(charCode:int):Boolean

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns true if charCode is a whitespace character.

The following table describes all characters that this method considers a whitespace character.

Character CodeUnicode Character NameCategory
0x0020SPACESpace Separator
0x1680OGHAM SPACE MARKSpace Separator
0x180EMONGOLIAN VOWEL SEPARATORSpace Separator
0x2000EN QUADSpace Separator
0x2001EM QUADSpace Separator
0x2002EN SPACESpace Separator
0x2003EM SPACESpace Separator
0x2004THREE-PER-EM SPACESpace Separator
0x2005FOUR-PER-EM SPACESpace Separator
0x2006SIX-PER-EM SPACESpace Separator
0x2007FIGURE SPACESpace Separator
0x2008PUNCTUATION SPACESpace Separator
0x2009THIN SPACESpace Separator
0x200AHAIR SPACESpace Separator
0x202FNARROW NO-BREAK SPACESpace Separator
0x205FMEDIUM MATHEMATICAL SPACESpace Separator
0x3000IDEOGRAPHIC SPACESpace Separator
0x2028LINE SEPARATORLine Separator
0x2029PARAGRAPH SEPARATORParagraph Separator
0x0009CHARACTER TABULATIONOther
0x000ALINE FEEDOther
0x000BLINE TABULATIONOther
0x000CFORM FEEDOther
0x000DCARRIAGE RETURNOther
0x0085NEXT LINEOther
0x00A0NO-BREAK SPACEOther

Parameters

charCode:int — An integer that represents a character code. Character codes are usually represented in hexadecimal format. For example, the space character's character code can be represented by the number 0x0020.

Returns
Booleantrue if charCode is a whitespace character.