|
|
| Just another Perl shrine | |
| PerlMonks |
Re: How can i get a substring from a String?by krusty (Hermit) |
| on Oct 16, 2008 at 11:56 UTC ( #717461=note: print w/ replies, xml ) | Need Help?? |
|
The solution proposed with substr will work, but only if the preceding characters before www.google.com are always 10 characters long. If that is always the case, then substr will work well. If the character length preceding your URL is variable, may I suggest split and join?
The code will only work if there are exactly two dot separated strings prior to the url. If that, too, is variable, then perhaps you could try this small modification:
Cheers, Kristina
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||