For example, ":speed iiKind 100", how would you split it into multiple words? Would you use string.sub()? string.find()? etc?
✓ ANSWER ACCEPTED
How do you split a string into multiple words?
1 answer
✓ Accepted answer
You can use string.gmatch() for it :
local str = ":speed iiKind 100"
for word in string.gmatch(str, "[^ ]+") do
print(word)
end
https://www.robloxdev.com/articles/string-patterns-reference
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
string.sub my friend
don't use string.sub, i tried that once and it was a pain, just use string.match
STRING MANIPULATIONNNNNNNNNNNNNNNNNNNNNNnnn