my $str = 'ABCOPCOGNHVCOHL'; my $index = 0; while (($index = index($str, 'CO', $index)) > -1) { substr $str, $index, 2, 'C/O'; } print "$str\n"; __END__ ABC/OPC/OGNHVC/OHL
In reply to Re: How to insert a "/" within a string?
by trizen
in thread How to insert a "/" within a string?
by rsvp1920
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |