| || |
String parsing methods
I am capturing all of the receipt data into a string and want to parse this string.
problem: i want to parse the string receipt and store each line of the receipt into a sub string and the whole receipt into an array of sub strings.
I am using split function with delimiter "/n" and "VbcrLf", still no luck.
Any other ways to approach this problem.
Thanks in advance,
Re: String parsing methods
There are only so many new line characters in VBScript.
Try splitting with the following delimiters:
If none of these work, take the opposite approach. Extract the correct delimiter using mid:
If you know a line ends after 24 characters:
This will return the ASCII code of the delimiter. I would also check if the delimiter is composed of the characters, so I would check the 26th character as well.
Once you got the code (let's say it's stored in iDelimiter), you can use split with it:
arrAll = Split(sEntireString, Chr(iDelimiter))
Best of luck.