User Guide

220 Working with Strings
Example: ASCII Art
This ASCII Art example shows a number of features of working with the String class in
ActionScript 3.0, including the following:
The split() method of the String class is used to extract values from a character-
delimited string (image information in a tab-delimited text file).
Several string-manipulation techniques, including split(), concatenation, and extracting
a portion of the string using
substring() and substr(), are used to capitalize the first
letter of each word in the image titles.
The getCharAt() method is used to get a single character from a string (to determine the
ASCII character corresponding to a grayscale bitmap value).
String concatenation is used to build up the ASCII art representation of an image one
character at a time.
The term ASCII art refers to a text representations of an image, in which a grid of
monospaced font characters, such as Courier New characters, plots the image. The following
image shows an example of ASCII art produced by the application:
The ASCII art version of the graphic is shown on the right.