H
hofer
Hi,
Let's look at following example:
$text = "Today is a nice day";
$end = "day";
print "text ends with $end" if $text =~ /$end$/;
Would the regular expression be efficient for long strings?
The alternative is a little more awkward to type
print "text ends with $end" substr($text,-length($end)) eq $end; # I
didn't try this line, but it should work I think
Is there any core module containing something like
print "text ends with $end" if endswith($text,$end);
thans and bye
H
Let's look at following example:
$text = "Today is a nice day";
$end = "day";
print "text ends with $end" if $text =~ /$end$/;
Would the regular expression be efficient for long strings?
The alternative is a little more awkward to type
print "text ends with $end" substr($text,-length($end)) eq $end; # I
didn't try this line, but it should work I think
Is there any core module containing something like
print "text ends with $end" if endswith($text,$end);
thans and bye
H