Matthew Fischer wrote:
> What is the best way to find the number of occurences of a specific character in a
>string?
Here is OMWTDI, "matching" instead of "replacing":
$_ = "abc" x 10;
while (m,a,g) { $x++ };
print "Letter 'a' was found $x times";
And seamingly it is not slow.
Detlef
- [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
