in reply to Re^2: Check last character of a string
in thread Check last character of a string
For the sake of completeness the code I used to verify that it worked with the "eq" operator. And for the record: I'd prefer a RegExp myself in this situation;-)
use strict; use warnings; my $location = "some location\\"; my $var = substr($location,length($location)-1,1); if ($var eq "\\"){ print "HIER IS ES\n\n"; } else{ $location = $location."\\"; print "NEU:: $location\n\n" ; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Check last character of a string
by LesleyB (Friar) on Aug 07, 2008 at 11:48 UTC |