in reply to count number of occurrences of specific character(s) in a string

$n = () = '((1,2)(b,c)' =~ /[()]/g; print $n;
Special thanks to tinita on irc. Golf anyone?


holli

When you're up to your ass in alligators, it's difficult to remember that your original purpose was to drain the swamp.
  • Comment on Re: count number of occurrences of specific character(s) in a string
  • Download Code