in reply to split a string at a defined index
You can split at the last comma by using a lookahead to check there are no more commas:
print for split /,(?=[^,]+$)/, "www,google,yahoo,345";; www,google,yahoo 345
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: split a string at a defined index
by AnomalousMonk (Archbishop) on Mar 29, 2010 at 08:09 UTC | |
by BrowserUk (Patriarch) on Mar 29, 2010 at 08:19 UTC |