Insert Character Into String At Specific Interval
Posted on 2011-03-08
Using Classic ASP (not ASP.net), I wish to manipulate a string as follows:
Original String: ABCDEFGHIJKLMNOPQRSTUVWXYZ
New String: |AB|CD|EF|GH|IJ|KL|MN|OP|QR|ST|UV|WX|YZ
So basically, starting at the beginning by inserting the character, and after every two characters of the string, I wish to insert a character - in this case, the pipe symbol.
I am sure there is some sort of easy loop that can accomplish this, but I just can't think of it.
Any help someone can provide would be greatly appreciated.