Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i get the second value of string.gsub?

string.gsub("121113", "1", "1") returns when printing a second value. How do i get that second value?

print(string.gsub("12113", "1", "1"))

returns:

121113 3

how do i get that last "3" ?

what i tryed:

local Number = string.gsub("12113", "1", "1")
print(string.gsub(Number,"12113", ""))

1 answer

✓ Accepted answer
local string, matches = string.gsub("12113","1","1")
print(string)
print(matches)

Output:

12113 3

This discussion is preserved as it was. New answers, comments, and votes are closed.