Archive for September 8th, 2007

08
Sep

Substituting values in strings using the Flex StringUtil class’s substitute() method

The following example shows how you can substitute values in a string with specified values using the static StringUtil.substitute() method in Flex. Similar to the printf() and sprintf() methods in other languages.

Full code after the jump.

Continue reading ‘Substituting values in strings using the Flex StringUtil class’s substitute() method’

08
Sep

Checking if a character is whitespace using the Flex StringUtil class’s isWhitespace() method

The following example shows how you can check whether a character is a whitespace character by using the isWhitespace() method in the mx.utils.StringUtil class. And just for giggles, I also show how you can do the same thing using regular expressions (RegExp) with POSIX character classes.

Full code after the jump.

Continue reading ‘Checking if a character is whitespace using the Flex StringUtil class’s isWhitespace() method’