I tried it with replacing 'M' with 'M' and it worked. No need to worry about exotic characters.
use 5.014; say 'iiiiiiiiMMMMMMMMMMMooooooooooooMMMMMMMMMMiiiiiMMMMMMMMoooo' =~ tr/M/M/sr=~tr/M//; # => prints: 3
In reply to Re^4: Can you write a faster code to perform this task?
by Lotus1
in thread Can you write a faster code to perform this task?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |