this worked for me:

use warnings;
use strict;

my $string = qq(one" two" three" four");
$string =~ s/\"$//; # replace last " with nothing
print "$string\n";

__END__

What did your code look like?
What version of perl are you using?


> -----Original Message-----
> From: Scot Robnett [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 17, 2002 1:32 PM
> To: [EMAIL PROTECTED]
> Subject: Removing the last character from a string
> 
> 
> How would I remove only the *last* quote from this string?
> 
>       my $string = qq(one" two" three" four");
> 
> 
> The result I am looking for replaces this:
> 
>       one" two" three" four"
> 
> 
> with this:
> 
>       one" two" three" four
> 
> 
> This did not work:
> 
>       $string =~ s/\"$//; # replace last " with nothing
> 
> 
> -----
> Scot Robnett
> inSite Internet Solutions
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.349 / Virus Database: 195 - Release Date: 4/15/2002
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to