in reply to Re^2: Can you write a faster code to perform this task?
in thread Can you write a faster code to perform this task?
Update: just to be sure, it would be safer to replace 'M' with something much exotic, like '\0', which should be OK, assuming that you're reading text files. (tr/M/\0/sr =~ tr/\0//)use 5.014; say 'iiiiiiiiMMMMMMMMMMMooooooooooooMMMMMMMMMMiiiiiMMMMMMMMoooo' =~ tr/M/~/sr=~tr/~//; # => prints: 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Can you write a faster code to perform this task?
by Lotus1 (Vicar) on Sep 29, 2014 at 18:30 UTC | |
by BrowserUk (Patriarch) on Sep 29, 2014 at 19:38 UTC | |
|
Re^4: Can you write a faster code to perform this task?
by LanX (Saint) on Sep 29, 2014 at 12:07 UTC | |
by Your Mother (Archbishop) on Sep 29, 2014 at 16:02 UTC | |
by LanX (Saint) on Sep 29, 2014 at 17:56 UTC |