Ever needed a text excerpt which would must not be longer then 200chars, but must end with a whole world? You have two options:
1. program the function by yourself
or
2. use the wonderful AS3 String Utils class by gskinner, namely the block function.
The package comes with many other useful functions:
afterFirst()
Returns everything after the first occurrence of the provided character in the string.
afterLast()
Returns everything after the last occurence of the provided character in p_string.
beginsWith()
Determines whether the specified string begins with the specified prefix.
beforeFirst()
Returns everything before the first occurrence of the provided character in the string.
beforeLast()
Returns everything before the last occurrence of the provided character in the string.
between()
Returns everything after the first occurance of p_start and before the first occurrence of p_end in p_string
block()
Description, Utility method that intelligently breaks up your string, allowing you to create blocks of readable text. This method returns you the closest possible match to the p_delim paramater, while keeping the text length within the p_len paramter. If a match can't be found in your specified length an '...' is added to that block, and the blocking continues untill all the text is broken apart.
capitalize()
Capitallizes the first word in a string or all words.
contains()
Determines whether the specified string contains any instances of p_char.
countof()
Determines the number of times a charactor or sub-string appears within the string.
editDistance()
Levenshtein distance (editDistance) is a measure of the similarity between two strings, The distance is the number of deletions, insertions, or substitutions required to transform p_source into p_target.
endsWith()
Determines whether the specified string ends with the specified suffix.
hasText()
Determines whether the specified string contains text.
isEmpty()
Determines whether the specified string contains any characters.
isNumeric()
Determines whether the specified string is numeric.
padLeft()
Pads p_string with specified character to a specified length from the left.
padRight()
Pads p_string with specified character to a specified length from the right.
properCase()
Properly cases' the string in "sentence format".
quote()
Escapes all of the characters in a string to create a friendly "quotable" sting
remove()
Removes all instances of the remove string in the input string.
removeExtraWhiteSpace()
emoves extraneous whitespace (extra spaces, tabs, line breaks, etc) from the specified string.
reverse()
Returns the specified string in reverse character order.
reverseWords()
Returns the specified string in reverse word order.
similarity()
Determines the percentage of similiarity, based on editDistance
stripTags()
Remove's all < and > based tags from a string
swapCase()
Swaps the casing of a string.
trim()
Removes whitespace from the front and the end of the specified string.
trimLeft()
Removes whitespace from the front (left-side) of the specified string.
trimRight()
Removes whitespace from the end (right-side) of the specified string.
wordCount()
Determins the number of words in a string.
truncate()
Returns a string truncated to a specified length with optional suffix



