lua-users home
lua-l archive

Re: gmatch problem

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> local str=" A1 blah AA boo Ax "
> 
> local function getCase(A,str)
> local nextCase = string.gmatch(str,"%u%w")
> local N=nextCase()
> while N ~= nil do
> -- if type(Q[N]) == 'table' then A[N] = #Q[N] end
 print(N)
> N=nextCase()
> end
> return A
> end
With this small change, the call 'getCase(nil, str)' prints A1, AA, and
Ax in my machine. I don't think you have a "gmatch problem"; the problem
seems to be somewhere else.
-- Roberto

AltStyle によって変換されたページ (->オリジナル) /