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

Can someone give me an example of this string match?

update = currentCard.name:match("(.*) | (.*)")

Like how would the string be formatted? I was on the ROBLOX wiki but I was still confused.

1 answer

✓ Accepted answer

If the string you perform it on is correct, it should return two values:

var1,var2 = string.match(str,"(.*) | (.*)")

You are essentially capturing what's in the brackets, so of course to catch two rats you need two nets (to put it into metaphor).

As for the individual strings, they would be like similar to this:

string = "hello | world"

returned1,returned2 = "hello","world"

Hope I helped!

~TDP

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