|
always add punctuation unless it already exists
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Lilbopeep
USA (42 posts) bio
|
| Date |
Wed 07 Dec 2011 02:41 AM (UTC) [ quote
] |
| Message |
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.
|
,.~`'~.,Dance Magic Dance,.~`'~., | top |
|
| Posted by |
Fiendish
USA (848 posts) bio
Global Moderator |
| Date |
Reply #1 on Wed 07 Dec 2011 03:21 AM (UTC) [ quote
] Amended on Wed 07 Dec 2011 03:25 AM (UTC) by Fiendish
|
| Message |
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
|
http://aardwolfclientpackage.googlecode.com/ | top |
|
| Posted by |
Lilbopeep
USA (42 posts) bio
|
| Date |
Reply #2 on Wed 07 Dec 2011 03:56 AM (UTC) [ quote
] |
| Message |
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 ..")
|
,.~`'~.,Dance Magic Dance,.~`'~., | top |
|
| Posted by |
Fiendish
USA (848 posts) bio
Global Moderator |
| Date |
Reply #3 on Wed 07 Dec 2011 04:59 AM (UTC) [ quote
] |
| Message |
Lilbopeep said:
ColourNote ("Black", "Blue", " You clanned .. your_string ..")
is wrong.
You need
ColourNote ("Black", "Blue", " You clanned ".. your_string)
|
http://aardwolfclientpackage.googlecode.com/ | top |
|
| Posted by |
Lilbopeep
USA (42 posts) bio
|
| Date |
Reply #4 on Wed 07 Dec 2011 06:33 AM (UTC) [ quote
] |
| Message |
| perfect. Thanks for the help! |
,.~`'~.,Dance Magic Dance,.~`'~., | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
780 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )