Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I check if a string includes a certain phrase?

Asked by
uui 25
4 days ago

I want to check if a variable named "custom" includes the text "http://www.roblox.com/asset/?id=" How would I go about doing this?

2 answers

Log in to vote
1
Answered by 4 days ago

So you could do something like this for an if statement

local Matched = string.match("https://whatsgood.com/", "https?://")

if not Matched then
    return 
end

print("found")
Ad
Log in to vote
0
Answered by
uui 25
4 days ago

Update: ~~~~~~~~~~~~~~~~~

print(string.match("https://whatsgood.com/", "https?://") ~= nil )

How would I do an if statement with this?

Answer this question