#! usr/bin/perl my ($occ,$str); $str="hi there this is perl monks forum."; print "enter number of occurence where you want to split\n"; $occ=<STDIN>; chomp($occ); $str=~ /(\S+\s){$occ}/; print "left : $& \nRight: $'\n";
In reply to Re: Split String after nth occurrence of a charater
by ansh batra
in thread Split String after nth occurrence of a charater
by Amiru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |