It looks like you're new here. If you want to get involved, click one of these buttons!
--local str = "A string without special characters." local str = "A string with special characters åäö." local str_unique_chars = "" for i=1, #str do local c1 = str:sub(i,i) local add_char = true for n=1, #str_unique_chars do local c2 = str_unique_chars:sub(n,n) if c1 == c2 then add_char = false break end end if add_char then str_unique_chars = str_unique_chars .. c1 end end print( str_unique_chars ) -- Returns: A stringwhpecalå��. |
Comments
http://docs.giderosmobile.com/reference/lua/utf8
http://giderosmobile.com/forum/discussion/comment/46501#Comment_46501
Likes: antix
With it you can also cache all chars you need with the following code:
Likes: totebo, pie