gerov
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 5504 |
|
|
| 18 Mar 2015 03:44 PM |
Is there a way to get a string after a string.
I know that was confusing, so let me describe a bit more.
Say I had this string
local example = "test: 123 abc"
And I wanted to get the 123 after test, but I had no idea how long the 123 was, and I don't want get the abc at the end.
I also don't know what 123 is, because that is the part I want to get.
Just getting started! Send some trades :) - http://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=14600251 |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2015 03:52 PM |
It depends on what the content could be.
Is it an integer number only? %d+ Is it letters only? %a+ Is it letters or numbers only? %w+ Is it anything other than whitespace (space, newline, tab)? %S+
local ex = "test: 123 abc" local after = ex:match("test: (%w+)") print( after ) --> 123 |
|
|
| Report Abuse |
|
|
gerov
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 5504 |
|
|
| 18 Mar 2015 03:56 PM |
Thanks :) That is exactly what I needed.
Just getting started! Send some trades :) - http://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=14600251 |
|
|
| Report Abuse |
|
|