Removing New Lines from input

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Hello,
I'm back again. I have a question. I am sure that this worked before, but now I am having problems with it. This little snippet of code is supposed to remove all of the /n's from the users input and replace it with a .

$address =~ s/\n//g;

The problem is, is that when it is printed to the text file, it still puts the information on a newline where the user pressed . Why is this? Is there some other pagebreak thing I should be searching for?

Thanks for all your help.
VulKen
King Of My Own Domain!

Pimpin like a pimp with an electrofied pimpin machine!

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Once again....after much adou I figured it out on my own..in case anyone wants to know, the code for it is..

$address =~ s!\r\n!!g;

VulKen
Everyone but me probably already knew that

Pimpin like a pimp with an electrofied pimpin machine!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.