Flash ASCII and Unicode Characters

Create Strings

The String class is used to represent string (textual) data in ActionScript 3.0. ActionScript strings support both ASCII and Unicode characters. The simplest way to create a string is to use a string literal.

To use single quotation marks (') within a string literal defined with single quotation mark (') delimiters, use the backslash escape character (\). Similarly, to use double quotation marks (") within a string literal defined with double quotation marks (") delimiters, use the backslash escape character (\). The following two strings are equivalent:

var str1:String = "That's \"A-OK\"";
var str2:String = 'That\'s "A-OK"';

Special Flash Characters

\b - Backspace

\f - Form feed

\n - Newline

\r - Carriage return

\t - Tab

\unnnn - The Unicode character with the character code specified by the hexadecimal number nnnn; for example, \u263a is the smiley character.

\xnn - The ASCII character with the character code specified by the hexadecimal number nn

\' - Single quotation mark

\" - Double quotation mark

\\ - Single backslash character