Re: removing spaces from the end of a string WITHOUT a REGEX

2001-08-30 Thread Edwin Günthner
Why not using chomp instead? from perlfunc: "This safer version of chop removes any trailing string that corresponds to the current value of $/ ..." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: removing spaces from the end of a string WITHOUT a REGEX

2001-08-30 Thread John Edwards
$test = chop; chop $data unless $test ne " "; } until ($test ne " "); --- But I still think the regex is the best way HTH John -Original Message- From: Hamish Whittal [mailto:[EMAIL PROTECTED]] Sent: 30 August 2001 16:02 To: perl beginners Subject: removing s

removing spaces from the end of a string WITHOUT a REGEX

2001-08-30 Thread Hamish Whittal
Hi all, I have a string I want to remove spaces from but without the use of a regex. e.g. 'This is a very long string ', I want to store as 'This is a very long string' Notice the removal of 4 spaces at the end. The number of spaces at the end is variable. If I have to use a regex I will, but t