Hello!
So let's say I have:
Dim MainString as string, Substring as string
Dim Result as Boolean
MainString ="ABCDE|ABCDF|CGHMN|QRSTU|CJKLM"
Question: Is there an easier (faster) way to check whether MainString contains all elements of Substring without using loops?
Example 1: If Substring ="QRSTU|ABCDE|CGHMN" then Result = True since all elements of Substring are found in MainString.
Example 2: If Substring ="ABCDF|QRSTU|HPXYZ" then Result = False since not all elements of Substring are found in MainString.
Is there a way to perform these checks to see whether all the elements in Substring exist in MainString without using loops? I have thought about the Instr function, the Like operator, etc, However, it appears in each case I will have to use a loop.
Any help would be appreciated.
Eddny
So let's say I have:
Dim MainString as string, Substring as string
Dim Result as Boolean
MainString ="ABCDE|ABCDF|CGHMN|QRSTU|CJKLM"
Question: Is there an easier (faster) way to check whether MainString contains all elements of Substring without using loops?
Example 1: If Substring ="QRSTU|ABCDE|CGHMN" then Result = True since all elements of Substring are found in MainString.
Example 2: If Substring ="ABCDF|QRSTU|HPXYZ" then Result = False since not all elements of Substring are found in MainString.
Is there a way to perform these checks to see whether all the elements in Substring exist in MainString without using loops? I have thought about the Instr function, the Like operator, etc, However, it appears in each case I will have to use a loop.
Any help would be appreciated.
Eddny
Last edited: