package com.imt.intimamedia.helpers { import mx.formatters.DateFormatter; public class FormatString { public function FormatString() { } public static function formatWithoutSpace( value : String ) : String { var returnString : String = ""; var i : int; for( i = 0; i < value.length; i++ ) { if( ( value.charAt(i) != " " ) && ( value.charAt(i) != "_" ) && ( value.charAt(i) != "-") && ( value.charAt(i) != ",") && ( value.charAt(i) != ".") ) { returnString += value.charAt(i); } } return returnString.toLowerCase(); } public static function generateRandomUID() : String { var userAlphabet : String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; var alphabet : Array = userAlphabet.split(""); var alphabetLength : int = alphabet.length; var randomLetters : String = ""; for( var count : uint = 0; count < 10; count++ ) { randomLetters += alphabet[ int( Math.floor( Math.random() * alphabetLength ) ) ]; } return randomLetters; } } }