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.

Reply via email to