Try this:
private function trimspace(txt_s:Object):void {
if ("text" in txt_s && txt_s.text is String)
txt_s.text = txt_s.text.replace(/^\s*/,"").replace(/\s*$/,"");
}
-J
On Fri, May 30, 2008 at 1:21 PM, Ganesh Suyampirakasam <
[EMAIL PROTECTED]> wrote:
> Hi
>
> I am Using Function named Trimspace.
>
> i am using that function in Focusout of the textInput field.
>
> For that Text input Field its Trimming the space Properly.
>
> But when i use same thing for the TestArea Field its Not trimming the
> Space..
>
> wat may be the wrong with that..
>
> Give me the Solution
>
> Trimspace Function is here
>
> private function trimspace(txt_s:Object):void{
> var temp:TextInput = TextInput(txt_s);
> var txt_str:String=temp.text;
> while (txt_str.charAt(0) == " ") {
> txt_str = txt_str.substring(1, txt_str.length);
> }
> while (txt_str.charAt(txt_str.length-1) == " ") {
> txt_str = txt_str.substring(0, txt_str.length-1);
> }
> //trace(txt_str);
> temp.text=txt_str;
> }
>
> Thx in Advance
>
> Ganesh Suyampirakasam
>
> ------------------------------
> Best Jokes, Best Friends, Best Food. Get all this and more on Best of
> Yahoo!
> Groups.<http://in.rd.yahoo.com/tagline_groups_11/*http://in.promos.yahoo.com/groups/bestofyahoo/>
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]