Nov 17, 2004 #1 JaySang Technical User Jun 26, 2003 43 CA Is there such a command that will remove a line from a varibale ?
Nov 17, 2004 1 #2 toolkit Programmer Aug 5, 2001 771 GB chomp ? Code: $string = "foo\n"; chomp($string); Cheers, Neil Upvote 0 Downvote
Nov 17, 2004 Thread starter #3 JaySang Technical User Jun 26, 2003 43 CA but what is you had a $string = "Foo\nFoo2"; and you wanted to remove the new line between Upvote 0 Downvote
Nov 17, 2004 #4 toolkit Programmer Aug 5, 2001 771 GB Code: $string = "Foo\nFoo2"; $string =~ s/\n//g; Cheers, Neil Upvote 0 Downvote
Nov 17, 2004 #5 mlibeson Programmer Mar 6, 2002 311 US If you are working with a Windows OS file, then you might need to remove the \r (Carriage Return) as well as the \n (New Line). Here is the expression: Code: s/[\n\r]//g Michael Libeson Upvote 0 Downvote
If you are working with a Windows OS file, then you might need to remove the \r (Carriage Return) as well as the \n (New Line). Here is the expression: Code: s/[\n\r]//g Michael Libeson