This might not be the best way, and I haven’t tested it but it ought to put an underscore between any number of words
[code]
local string1=“Google this” --the original string
local temptable={} --a temporary table to store each word
for w in string.gmatch(string1, “%w+”) do --pulls out words separated by spaces
table.insert(temptable,w)–inserts them into a table on word per row
end
local string2=temptable[1] --initialises the new string with the first word
for n=2,#temptable do
string2=string2…"_"…temptable[n] --adds all subsequent words with a dash in between
end
print(string2) – results in “google_this”
[/code] [import]uid: 95579 topic_id: 17608 reply_id: 67040[/import]