The String Class

Get Adobe Flash player

The String class is built-in to Flash. Just as there are many operations we can do with numbers, such as adding and subtracting, there are many operations we can do with Strings.

  • Start a new ActionScript 3 file.
  • In the ActionScript window declare a String variable with an initial value:


When you type s. the list of methods will appear.
Type trace(s.charAt(3));

You will see the letter D in the output window. Like most things in computers, numbering starts with 0.  Thus, s.charAt(0) is the letter A.

NEXT: String Functions

INDEX, The String Class, String Functions, Anagrams, Cryptograms

Like us on Facebook: