There is an old saying. Give a man a fish and feed him for a day.
Teach a man to fish and feed him for a life time. Instead of us just
telling you a regexp to do it, you should really learn regexps since
they are what perl is all about. I highly recommend O'Reillys
"Mastering Regular Expressions" by Jeffrey Friedl. But, any good perl
book will at least touch base about Regexps.
Anyway, there are a few ways you can do it. First is to use the built
in function chomp(). It removes new line chars from the end of a
string. The other way you could do it is with a regexp. Something
like:
$foo =~ s/\s$//;
I'm guessing since you are using a textarea you will run into the
wonderful \r characters (Carriage Returns). The above should snag them.
As should chomp.
Hope this helps you. :o)
-Brian
> Hi People,
>
> I need to remove all new line character from a string. Can you please
> let me know. This is to use for
> a flat file. When i try to store from a textarea input to a flat file,
> it has many new line character from the input. Therefor, when retrieve
> them back from the flat file the data order are messed up. So please
> help me with this. Thanks.
>
> Piraba
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]