flashx.textLayout.utils

# CharacterUtil - AS3

Package | flashx.textLayout.utils
Class | public final class CharacterUtil
Inheritance | CharacterUtil 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
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
|  | isHighSurrogate(charCode:int):Boolean [static] Returns true if the charCode argument is a high word in a surrogate pair. | CharacterUtil
|  | isLowSurrogate(charCode:int):Boolean [static] Returns true if the charCode argument is a low word in a surrogate pair. | CharacterUtil
|  | 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(charCode:int):Boolean [static] Returns true if charCode is a whitespace character. | CharacterUtil
|  | 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
|  | 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
|  | valueOf():Object 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

| `Boolean` — `true` 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

| `Boolean` — `true` 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 Code | Unicode Character Name | Category
--- | --- | ---
`0x0020` | SPACE | Space Separator
`0x1680` | OGHAM SPACE MARK | Space Separator
`0x180E` | MONGOLIAN VOWEL SEPARATOR | Space Separator
`0x2000` | EN QUAD | Space Separator
`0x2001` | EM QUAD | Space Separator
`0x2002` | EN SPACE | Space Separator
`0x2003` | EM SPACE | Space Separator
`0x2004` | THREE-PER-EM SPACE | Space Separator
`0x2005` | FOUR-PER-EM SPACE | Space Separator
`0x2006` | SIX-PER-EM SPACE | Space Separator
`0x2007` | FIGURE SPACE | Space Separator
`0x2008` | PUNCTUATION SPACE | Space Separator
`0x2009` | THIN SPACE | Space Separator
`0x200A` | HAIR SPACE | Space Separator
`0x202F` | NARROW NO-BREAK SPACE | Space Separator
`0x205F` | MEDIUM MATHEMATICAL SPACE | Space Separator
`0x3000` | IDEOGRAPHIC SPACE | Space Separator
`0x2028` | LINE SEPARATOR | Line Separator
`0x2029` | PARAGRAPH SEPARATOR | Paragraph Separator
`0x0009` | CHARACTER TABULATION | Other
`0x000A` | LINE FEED | Other
`0x000B` | LINE TABULATION | Other
`0x000C` | FORM FEED | Other
`0x000D` | CARRIAGE RETURN | Other
`0x0085` | NEXT LINE | Other
`0x00A0` | NO-BREAK SPACE | Other

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

| `Boolean` — `true` if `charCode` is a whitespace character.

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