I’m doing text wrapping (to separate long string into lines) in corona
function wrap(str, limit, indent, indent1) indent = indent or "" indent1 = indent1 or indent limit = limit or 72 local here = 1-#indent1 str = replacePartOfString(str,"\*","\n") return indent1..str:gsub("(%s+)()(%S+)()", function(sp, st, word, fi) if fi-here \> limit then here = st - #indent return "\n"..indent..word end end) end local someString = " This is intended for strings without newlines in them (i.e. after reflowing the text and breaking it into paragraphs.) This is intended for strings without newlines in them (i.e. after reflowing the text and breaking it into paragraphs.) This is intended for strings without newlines in them (i.e. after reflowing the text and breaking it into paragraphs.) This is intended for strings without newlines in them (i.e. after reflowing the text and breaking it into paragraphs.) " print\_r(string.split(wrap(someString,70,"",""),"\n"))
it works fine with english and arabic, but the only problem is it counts the tashkeel in arabic as letters, what is the best way to ignore these characters and not count them? I want to keep them, but not count them in text wrapping.
