Re: [flexcoders] AS equivalent for perl's chop/chomp?

2008-10-17 Thread john fisher
thanks Guy
and of course you're right  if they irritate my sense of code style, I
can just wrap them up.
Just thought I'd ask in case I missed something.
John

Guy Morton wrote:
 I don't think so...I've never seen one, but what's hard about using
 String.replace? Aren't the following functionally equivalent?

 //perl's chomp
 String.replace(/[\r\n]*$/);

 //perl's chop
 String.replace(/.$/);

 I guess if you really care, you could extend the String class to add
 them?

 Guy




[flexcoders] AS equivalent for perl's chop/chomp?

2008-10-16 Thread john fisher
I see String.replace using a regex, but is there a more straightforward
way to do this (very) common adjustment?

(perl: chop and chomp delete the last character from a string in
slightly different ways)

thanks,
John


Re: [flexcoders] AS equivalent for perl's chop/chomp?

2008-10-16 Thread Guy Morton
I don't think so...I've never seen one, but what's hard about using  
String.replace? Aren't the following functionally equivalent?


//perl's chomp
String.replace(/[\r\n]*$/);

//perl's chop
String.replace(/.$/);

I guess if you really care, you could extend the String class to add  
them?


Guy


On 17/10/2008, at 11:27 AM, john fisher wrote:

I see String.replace using a regex, but is there a more  
straightforward

way to do this (very) common adjustment?

(perl: chop and chomp delete the last character from a string in
slightly different ways)

thanks,
John