Nov 17, 2004 #1 JaySang Technical User Joined Jun 26, 2003 Messages 43 Location CA Is there such a command that will remove a line from a varibale ?
Nov 17, 2004 1 #2 toolkit Programmer Joined Aug 5, 2001 Messages 771 Location GB chomp ? Code: $string = "foo\n"; chomp($string); Cheers, Neil Upvote 0 Downvote
Nov 17, 2004 Thread starter #3 JaySang Technical User Joined Jun 26, 2003 Messages 43 Location 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 Joined Aug 5, 2001 Messages 771 Location GB Code: $string = "Foo\nFoo2"; $string =~ s/\n//g; Cheers, Neil Upvote 0 Downvote
Nov 17, 2004 #5 mlibeson Programmer Joined Mar 6, 2002 Messages 311 Location 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