I would expect tr/// to be more fasterest. However, if it really matters you should write some code to benchmark the alternatives using Benchmark.
The real question though is: "Does it actually matter?". Unless the code fragment has been identified using a profiler as the time hog in code that is running too slowly to achieve some particular goal, write the fragment in the way that seems clearest and easiest to maintain.
In reply to Re: Which is more faster? While or tr///
by GrandFather
in thread Which is more faster? While or tr///
by tej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |