Hello,
I need a macro that will separate an inputted string into multiple strings.
Example 1
The string "text1,text2,text3" was inputted. The result should be:
ResultsArr(1) = "text1"
ResultsArr(2) = "text2"
ResultsArr(3) = "text3"
Example 2
The string "hello1,hello2,hello3,...,helloN" was inputted. The results should be:
ResultsArr(1) = "text1"
ResultsArr(2) = "text2"
ResultsArr(3) = "text3"
...
ResultsArr(N) = "textN"
Please note:Do you know what is the most efficient way to implement this?
- The text in the string is unknown. The only known fact is that the string contains commas. The characters between each comma should be extracted into separate strings.
- The size of the array can be determined by: (# of commas in the string) + 1
- We can assume that the size of the array will not exceed 20.
Any help will be very appreciated.
Thank you!