Skip to content

resolving "unknown variable" when using string.gsub() #493

Answered by JLPLabs
JLPLabs asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for the noise in your discussion list. I made this harder than it needed to be.

There is an easy answer... just had to tell it the types (consolidating to an anonymous function doesn't change the approach).

    blex = blex:gsub("[%d_%.]+", function(s: string):string, integer 
          return s:gsub("_","") end)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JLPLabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant