Hope this helps.$string="abc%def%.%"; $count = ($string =~ tr/%//); print "There are $count %s in the string";
In reply to Re: Counting how many times a character is in a string.
by marto
in thread Counting how many times a character is in a string.
by slloyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |