Splitting a string into each character..
Are you asking for a VBScript answer (you posted in a JScript newsgroup)?
strPart1 = Mid(myString,1,4)
strPart2 = Mid(myString,5,3)
strPart3 = Mid(myString,8,4)
In VBScript, the "start" position is the (1-based) ordinal position of the character.
strPart1 = String(myString).substr(0,4);
strPart2 = String(myString).substr(4,3);
strPart3 = String(myString).substr(7,4);
In JScript, the "start" position is the (0-based) offset of the character from the beginning of the string.
I have a reference number that I wish to split. The references look
I want to split them into 0201 564 F265.
I have tried using "Split" in VBScript but I cannot work out how to
either stipulate the number of characters or to split into every
character (to later put them back together in the format above).
Does anyone have any bright ideas ?
The other alternative is to find a way of comparing only certain
characters of the ref with the database. But this again requires more
knowledge of SQL than I possess.
Sent via Deja.com http://www.deja.com/
Before you buy.