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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -