Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to get string.gmatch to also print numbers?

Asked by
ItsMeKlc 235 Moderation Voter
9 years ago

Messing around, and I just wanted to know, is there a way to get string.gmatch to also print numbers?

s = ("a b c d e 1 2 3 4")
for w in string.gmatch(s, "%a+") do
    print(w)
end
0
According to the wiki http://wiki.roblox.com/index.php?title=String_patterns#Character_Classes you can print alphanumeric characters (both letters and numbers) with %w, or you can print straight up numbers with %d. M39a9am3R 3210 — 9y

1 answer

Log in to vote
0
Answered by
ItsMeKlc 235 Moderation Voter
9 years ago

Thank you, so much! :D

Ad

Answer this question