ryry60100
|
  |
| Joined: 04 Sep 2009 |
| Total Posts: 1964 |
|
|
| 23 Aug 2012 04:26 PM |
| I want to check if the last letter of a string is a period, question mark, exclamation point, or semicolon, how would I do this, and what are the bytecodes for them? |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 04:31 PM |
local StringName = "Hello"
local End = string.sub(StringName, #StringName) if End == "!" or End == "?" or End == "." then print("Proper grammar was likely used. :D") else print("No punctuation.") end
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
ryry60100
|
  |
| Joined: 04 Sep 2009 |
| Total Posts: 1964 |
|
|
| 23 Aug 2012 07:02 PM |
| Thanks. I guess I don't need the bytecodes, derp. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 07:26 PM |
local string="Stringggg!" local last_letter=string:sub(string:len()-1) |
|
|
| Report Abuse |
|
|