(1) Have strings like ABCD and want DCBA. Assume words are case-insensitive.
(1.1) The same example, using a RegEx with "quantifier" notation for the number of letters:
(2) Have strings like ABCD and want DCBA. Assume words are upper-case only.
(3) Have strings like ABCD and want ** AB-CD **
(4) Have AB1234 and want XY4321
(5) Have XX1234 and want XX4321 where XX are any existing characters
(6) Have XX1234 and want xx4321 where XX, xx are upper and lower case
(7) Have AB1234 and want A123
(8) Have AB1234 and want 123ABC
(9) Have AB1234 and want BB234
(10) Have strings like AB*12/34 and want AB1234*/ where * and / are some delimiters; we use 0 to “grab” all the column positions not otherwise specified and put them at the end, which are columns 3 and 6 in this example:
(11) Have ‘words’ of varying sizes; want to reverse first 3 characters and make upper case, then copy the rest of the string as-is. Example: abc12XyZ → CBA12XyZ
(12) Have ‘words’ of varying sizes; want to reverse first 3 characters and make upper case, then copy the rest of the string in reverse order in lower case. Example: abc12xyz → CBAzyx21
Have ‘words’ of varying sizes; want to reverse first 5 characters, and drop any characters after position 5.
What happens here if the word found is shorter than 5 characters? Suppose the string found is ABC. For mapping purposes, the string is treated in effect as if it were extended to the right with “null” characters, like this:
Then, the string order is reversed, like this:
Finally, the “null” characters are removed, and the result is CBA.
Note: The explanation above is just to help you understand. In reality, no “null” characters are actually used, so you can use mapping strings to reorder any data, even data having binary zeros. The character reversal process just goes from position 5 to position 1 as requested, but when positions 5 and 4 are asked for, it is found that there is no data in those positions and the copying action is simply ignored. So, internally, the command gets treated for this particular string as if you had specified this:
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator