[flexcoders] String Replace

2008-05-13 Thread Tom Preet
Hi,

In my application am using remote object method for retrieving data from
Java class.
in the ResultEvent am storing the values in String.

But the data from the java was displa,ying as
,aa,bb,cc,dd
,AA,BB,CC,DD
,ab,bc,bd  .

But, comma(,) Symbol is displaying before the starting of each and every
line.

For this I have used the String replacement where as comma(,) is replacing
by blankspace.
But, here each and every time  comma(,) is replacing by space.

I need to replace the first position instead of all the commas(,) in the
string.

can anyone help me how to achieve this.

Thanks,
Tomt.


RE: [flexcoders] String Replace

2008-05-13 Thread Alex Harui
What code did you use?  A regular string replace should just replace the
first match.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tom Preet
Sent: Tuesday, May 13, 2008 8:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] String Replace

 

Hi,

In my application am using remote object method for retrieving data from
Java class.
in the ResultEvent am storing the values in String.

But the data from the java was displa,ying as 
,aa,bb,cc,dd
,AA,BB,CC,DD
,ab,bc,bd  .

But, comma(,) Symbol is displaying before the starting of each and every
line.

For this I have used the String replacement where as comma(,) is
replacing by blankspace.
But, here each and every time  comma(,) is replacing by space.

I need to replace the first position instead of all the commas(,) in the
string.

can anyone help me how to achieve this.

Thanks,
Tomt.




 



Re: [flexcoders] String Replace

2008-05-13 Thread Josh McDonald
Not tested, but should be what you want

var s : String = ,AA,BB,CC,DD;
var regex : RegExp = /^\s*,/;
s = s.replace(regex,);

-J

On Wed, May 14, 2008 at 3:34 AM, Alex Harui [EMAIL PROTECTED] wrote:

What code did you use?  A regular string replace should just replace
 the first match.


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Tom Preet
 *Sent:* Tuesday, May 13, 2008 8:22 AM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] String Replace



 Hi,

 In my application am using remote object method for retrieving data from
 Java class.
 in the ResultEvent am storing the values in String.

 But the data from the java was displa,ying as
 ,aa,bb,cc,dd
 ,AA,BB,CC,DD
 ,ab,bc,bd  .

 But, comma(,) Symbol is displaying before the starting of each and every
 line.

 For this I have used the String replacement where as comma(,) is replacing
 by blankspace.
 But, here each and every time  comma(,) is replacing by space.

 I need to replace the first position instead of all the commas(,) in the
 string.

 can anyone help me how to achieve this.

 Thanks,
 Tomt.







-- 
Therefore, send not to know For whom the bell tolls. It tolls for thee.

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]