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

How do you find a string in a string, regardless of case?

Asked by
CPF2 406 Moderation Voter
6 years ago
Edited 6 years ago

I want to find a string in a string without it being case sensitive.

I thought of a way to possibly do it, but I can't help but think there should be a much simpler way, please tell me if you know a way to do it.

1 answer

Log in to vote
1
Answered by
cabbler 1942 Moderation Voter
6 years ago
local found = mainString:lower():find(searchString:lower(),1,true) ~= nil

where mainString and searchString are previously defined.

0
wow i'm actually retarded, I didn't take into account that you could lower both of the strings. CPF2 406 — 6y
Ad

Answer this question