|
| 23 Oct 2015 09:35 PM |
| If I wanted to get the word from 'Tip69' without the '69' part, can that be possible? |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Oct 2015 09:41 PM |
Yes. (via : http://wiki.roblox.com/index.php?title=Function_dump/String_manipulation - String.sub)
You can use (string).sub to get what you want.
ex:
local word = TipNumberPootis
word:sub(1,5) will return 1-5 (TipNu) |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:43 PM |
| I need something more exact. I want to get exactly tip, and make sure it's getting the tip nothing else. |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:46 PM |
If you want only alphabetical words, do this.
for Word in string.gmatch(YourString, "%a+") do -- Do something with Word end |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:47 PM |
are we still talking about scripting here?
True loyalty never dies. |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:48 PM |
Yes, that's what sub does.
local word = "AHHHHHHH Tip AHHHHHHH" -- phrase to look in local find = "Tip" -- the word you want to find local wordfind = 3 -- how many letters there are in it
local found = false local stringnumb = 0 repeat
stringnumb = stringnumb + 1 if word:sub(stringnumb,stringnumb+wordfind-1) == find then found = true end
until found == true |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:48 PM |
| I just want to breakdown the string 'Tip69' to just 'Tip'. |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:50 PM |
| What If there are multiple words like 'Tip', 'Bob', Joe'. I would scan all of them, and I want it to just scan 'Tip'. |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:53 PM |
So ONLY find Tip?
local Matched = string.match(SomeString, "Tip") |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:56 PM |
| What is the 'SomeString' part suppose to indicate? |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 09:57 PM |
The string you are searching
True loyalty never dies. |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 10:00 PM |
| But the string I'm searching for is 'Tip', and it's already there? 'SomeString, "Tip"'. It's confusing/bugging me. |
|
|
| Report Abuse |
|
|
|
| 23 Oct 2015 10:03 PM |
| I just realized what It mean't, my bad, and thanks. I'll try this out. |
|
|
| Report Abuse |
|
|