No matter how many lines it takes to write, if you've got to perform an operation on every element, it's (at least) an O(n) process. Give us some more information about the actual data you're converting. Is this something like a big-endian => little-endian conversion? Are the strings of a consistent length? Is it numeric data? In the case you show, it appears you want to change 0200104 to 220000 (tr/// would change the 0 in position 1 to a 2, the 1 in position 4 to a 0, and the 4 in position 6 to a 0). Is this correct?
In reply to Re^3: tr at a given pos
by swampyankee
in thread tr at a given pos
by FFRANK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |