lua - Remove all chars from a string except "a","b","c","d" -


i have string want replace chars , digits "", except chars a,b,c, d.

instead of having write multiple lines of long code in example below, there other way write more efficient?

mystring:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$%,]", "") --special chars ... --same chars ... --same digits 

use caret symbol ^ is, [^abcd]

caret symbol negates set.

e.g., can read more here.


Comments

Popular posts from this blog

renaming files in a directory using python or R -

html - outline-style different in chrome compared to firefox and internet explorer -

Images won't display through CSS -