| |||||||||||
| |||||||||||
any option other than substr Posted by kitwalker2886 (kitwalker2886), 11 May 2007 if i want to cut and retrieve a string between any teo symbols.. do i ve any option other than using substr. cos i need to use index to calculate the posn if i wanna use substr..Posted by admin (Graham Ellis), 11 May 2007 Here's a possible solution:earth-wind-and-fire:~/may07 grahamellis$ cat retwo $string = "Look-between-hyphens"; ($inbet) = $string =~ /-(.*)-/; print "$inbet\n"; earth-wind-and-fire:~/may07 grahamellis$ perl retwo between earth-wind-and-fire:~/may07 grahamellis$ This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |