I am trying to count the number of times a "-" occurs in a string.
So, for example, this happens twice here 'a -b -c'
I tried the following, but it gives me 4 instead of 2, any idea why?
argv='a --b --c' count = 0 for i in string.gfind(argv, " --") do count = count + 1 end print(count)
Yaroslav bulatov
source share