Methods

StringUtils class

org.thesourcecode.utils.StringUtils

extends
String

 

Overview

Author

Hasan Otuome [hasan.otuome.com]

Version

0.1

Usage

import org.thesourcecode.utils.StringUtils;
var shortText:StringUtils = new StringUtils(string);

Description

Just a sub-class of the String class for storing some useful methods. This version only has (1) method: reduce().

Methods

 

reduce

Usage

myTextField.text = shortText(100,"...");

Description

Trims the string based on the limit that you pass in and attaches the "there's more" indicator of your choosing

Parameters

stringLength
(Number) indicates how many characters of the given string to display
trimIndicator
(String) indicates what you want to use to let a user know there's more text

Returns

String