About
Pricing
Community
Teams
Start Free Trial
Log in
ambuli
asked on
5/15/2011
Perl : How to remove a substring from a string
Hi Experts,
I have to print the portion of a string by removing anything before the word teststring in the following string.
this is: a long line teststring: this portion is needed
I want to print the new string as: this portion is needed.
Thank you
Perl
2
1
Last Comment
wilcoxon
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ravenpl
5/15/2011
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
wilcoxon
5/15/2011
More efficient would be:
$value =~ s/^.*?teststring//;
as there is no reason to capture the string being removed.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
$value =~ s/^.*?teststring//;
as there is no reason to capture the string being removed.