always add punctuation unless it already exists

Posted by Lilbopeep on Wed 07 Dec 2011 02:41 AM — 5 posts, 18,422 views.

USA #0
i've been trying to figure out how to do this. Basically, unless I have already used punctuation, I would like add a period to the end.
USA Global Moderator #1
In what language?

In Lua you could do something like...

punctuation_table = {"."=true,"?"=true,"!"=true}
if not punctuation_table[string.sub(your_string,-1)] then
   your_string = your_string.."."
end
Amended on Wed 07 Dec 2011 03:25 AM by Fiendish
USA #2
for instance ...

match on clan *


your_string = '%1'
punctuation_table = {"."=true,"?"=true,"!"=true}
if not punctuation_table[string.sub(your_string,-1)] then
   your_string = your_string.."."
end
ColourNote ("Black", "Blue", " You clanned .. your_string ..")

USA Global Moderator #3
Lilbopeep said:

ColourNote ("Black", "Blue", " You clanned .. your_string ..")
is wrong.

You need
ColourNote ("Black", "Blue", " You clanned ".. your_string)
USA #4
perfect. Thanks for the help!