Jan 8, 2007 #1 timgerr IS-IT--Management Jan 22, 2004 364 US I want to replace the last comma with nothing. Code: my $test = 'this,is,a,test,"; not user how do do this one. thanks -T -How important does a person have to be before they are considered assassinated instead of just murdered? -Need more cow bell!!!
I want to replace the last comma with nothing. Code: my $test = 'this,is,a,test,"; not user how do do this one. thanks -T -How important does a person have to be before they are considered assassinated instead of just murdered? -Need more cow bell!!!
Jan 8, 2007 #2 rharsh Technical User Apr 2, 2004 960 US Something like this might work for you: Code: $test =~ s/(.+),/$1/; That hasn't been tested, but it should work. Upvote 0 Downvote
Something like this might work for you: Code: $test =~ s/(.+),/$1/; That hasn't been tested, but it should work.
Jan 9, 2007 #3 1DMF Programmer Jan 18, 2005 8,795 GB or maybe this conveluted way Code: $test = substr($test,0,len($test)-1) . "?"; - lol "In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you. Upvote 0 Downvote
or maybe this conveluted way Code: $test = substr($test,0,len($test)-1) . "?"; - lol "In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
Jan 9, 2007 #4 KevinADC Technical User Jan 21, 2005 5,070 US or simply: Code: $test =~ s/,$//; but if you know for sure there is a comma on the end that needs removing and there is no newline or something else: Code: chop($test); - Kevin, perl coder unexceptional! Upvote 0 Downvote
or simply: Code: $test =~ s/,$//; but if you know for sure there is a comma on the end that needs removing and there is no newline or something else: Code: chop($test); - Kevin, perl coder unexceptional!
Jan 11, 2007 #5 MikeLacey MIS Nov 9, 1998 13,212 GB or... chop(chomp($test)); that will take of a newline if it's there Mike The options are: fast, cheap and right - pick any two. & Want great answers to your Tek-Tips questions? Have a look at faq219-2884 Upvote 0 Downvote
or... chop(chomp($test)); that will take of a newline if it's there Mike The options are: fast, cheap and right - pick any two. & Want great answers to your Tek-Tips questions? Have a look at faq219-2884