E
EllenM
Hello, I have incorporated the split function to isolate an array of
substrings within a string. It works fine, however, I need a way of
determining the number of substrings in any given array to avoid referencing
an index that is outside the array bounds. For instance, sometimes I could
have 3 substrings or other times 8 substrings. As such, something like the
following would fail for a string with only 3 substrings.
Split(MyData.GetText, vbCr)(5)
Anyone familiar with the split function will know that there is no element 5
in the above example. You get an “array out of bounds†error message or some
such thing. Is there a way of determining in advance the number of substrings
to avoid referencing an item that does not exist? I found Microsoft’s help
section confusing when studying the split() function.
Thanks,
Ellen
substrings within a string. It works fine, however, I need a way of
determining the number of substrings in any given array to avoid referencing
an index that is outside the array bounds. For instance, sometimes I could
have 3 substrings or other times 8 substrings. As such, something like the
following would fail for a string with only 3 substrings.
Split(MyData.GetText, vbCr)(5)
Anyone familiar with the split function will know that there is no element 5
in the above example. You get an “array out of bounds†error message or some
such thing. Is there a way of determining in advance the number of substrings
to avoid referencing an item that does not exist? I found Microsoft’s help
section confusing when studying the split() function.
Thanks,
Ellen