package org.igniterealtime.xiff.util
{
?//import mx.formatters.DateFormatter;
?public class Util
?{
??public function Util()
??{
??}
??????? public static function getNowDateFormat():String{??????? ?
??????? ? return (new Date().toTimeString().substr(0,8));
??? }??
??public static function getGenerate():String{
????? ?var i:int=Math.random()*99;
????? ?return i.toString();
????? }
??? public static function trim(str:String):String
????? {
?????????? var myPattern:RegExp = /</g;
??? str=str.replace(myPattern, "");? ???
??? if (str == null) return '';
????????? var startIndex:int = 0;
????????? while (isWhitespace(str.charAt(startIndex)))
????????????? ++startIndex;
??
????????? var endIndex:int = str.length - 1;
????????? while (isWhitespace(str.charAt(endIndex)))
????????????? --endIndex;
??
????????? if (endIndex >= startIndex)
????????????? return str.slice(startIndex, endIndex + 1);
????????? else
????????????? return "";
????? }
?public static function isWhitespace(character:String):Boolean
????? {
????????? switch (character)
????????? {
????????????? case " ":
????????????? case "\t":
????????????? case "\r":
????????????? case "\n":
????????????? case "\f":
????????????????? return true;
??
????????????? default:
????????????????? return false;
????????? }
????? }
???
??? }
?
}
大盤預測
國富論
posted on 2008-09-24 09:42
華夢行 閱讀(268)
評論(0) 編輯 收藏