|
| 20 Sep 2015 05:17 PM |
I've never really used Gmatch, I've always just made my own inefficient way to not have to learn it. I may be using it completely wrong, but.
for w in string.gmatch(game.Lighting.TimeOfDay, "%p") do print(w) end
I was hoping to use this to return the Hour, Minute, and Second of the time.
Sadly I'm only getting the colons. How could I use this to return the Hour, Minute, and Second? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 20 Sep 2015 05:20 PM |
I was using %p+ originally and it still returned the colons.
Though, it appears the %P+ fixed it. I don't see anywhere on the String Pattern page about the capitalized version. O.o |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Sep 2015 05:22 PM |
Here, this will help: http://www.lua.org/pil/20.2.html
Also: 'An upper case version of any of those classes represents the complement of the class.' |
|
|
| Report Abuse |
|
|
| |
|
cpmody
|
  |
| Joined: 16 Aug 2015 |
| Total Posts: 457 |
|
|
| 20 Sep 2015 05:45 PM |
| what does gmatch do, i forgot how to use most of the powerful string methods |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Sep 2015 05:45 PM |
| An iterator that repeatedly matches. |
|
|
| Report Abuse |
|
|