How do you search for a string in a chunk of text? It's something like the "Find" command in notepad or IE...
Printable View
How do you search for a string in a chunk of text? It's something like the "Find" command in notepad or IE...
if instr("abcdeft","b") then
end if
-----------------------------
instr will return 0 if it does not find a match and in this case it will return 2.
there if also a "like function" and a replace function
like operator you mean, yes it's faster than using instr if you don't need to return a specific position
Replace function doesnt do the trick, it only replaces, But ubound of the array of a split will return the amount of items found, although it's slow.Code:IF "abcdefghijk" like "*fg*" then msgbox "fg found"