Try:
$x='123|456||78|9|';
$z=$x=~s/\|/\|/g;
print "$x\n";
print "$z\n";
HTH
Dick
At 11:28 PM -0400 7/20/01, Matthew Fischer wrote:
>What is the best way to find the number of occurences of a specific
>character in a string? I have some form data which is in a variable
>$FORM{'countries'}, and I need to know how many pipe characters are
>contained within it.
>
>Thanks in advance for any help.
- [MacPerl] Get count of specific character Matthew Fischer
- Re: [MacPerl] Get count of specific character Dick Applebaum
- Re: [MacPerl] Get count of specific character Detlef Lindenthal
- Re: [MacPerl] Get count of specific character robinmcf
- Re: [MacPerl] Get count of specific character Ronald J Kimball
- Re: [MacPerl] Get count of specific character robinmcf
- Re: [MacPerl] Get count of specific character Detlef Lindenthal
- Re: [MacPerl] Get count of specific character Ronald J Kimball
