Hi,
We can find the number of occurences in many ways, but as far as I know we have to use the regular loops to get the position numbers with a few modifications
In the above code you can also replace strcomp with instr(1, string,"searchstring", compareType) to get the same result.
Cheers
We can find the number of occurences in many ways, but as far as I know we have to use the regular loops to get the position numbers with a few modifications
Code:
Dim i, index, arr()
index = 0
For i=1 to len(string)
If strcomp(Mid(string, i, 1), "[i]character to be searched[/i]", vbTextCompare) = 0 Then
redim preserve arr(index)
arr(index) = i
index = index+1
End If
Next
In the above code you can also replace strcomp with instr(1, string,"searchstring", compareType) to get the same result.
Cheers