Re: [pckanth] Removing \n in each line and make the content in a single line
[In reply to]

Can't Post

try:

Code

$input =~ /[\r\n]//g;

where $input is the data recieved from the textarea form field.

[\r\n] is a character class of carraige returns and newlines. The "g" modifier tells the regexp to find them all, and replacement pattern is blank so it removes them all. -------------------------------------------------