Find Delimiter that split string when multiple delimiters are defined

V

vang

How do I find out which delimiter if found/used when splitting a
string with multiple delimiters are defined in a char array?

Example:

dim i as integer
dim returnText as string
dim InputText as string = "apples/orange\banana"
dim delim as char = {"\", "/", "$")

dim segment() as string = InputText.split(delim)

for i = 0 to (segment.length -1)
returnText = segment(i)
write("Return value: " & returnText)
next
 
V

vang

I forgot to include that the inputText can be either = "apples/orange
\banana" or "apples\orange/banana"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top