String.find cant find "G" in "Gi"

if i try to call string.find like “String.Find(“G”, “Gi”)” then it returns nil. This script has always worked for me and now it does not? did roblox change how string.find works?

2 Likes

Reverse the arguments:

string.find("Gi", "G")
2 Likes

still returns nil even after i do that

1 Like

It should return 1, 1 unless you’re doing something wrong apart from that

try using string.lower like this:

if string.find(string.lower("Gi"), string.lower("G")) then
-- do stuff
end

Try using string.match("Gi","G").

yeah i had to do that, didnt know it was case sensitive

You should mark @Nek0_Stars’s post as the solution rather than yours. You didn’t solve the post rather THEY did… pretty sure that’s common sense… -_-

3 Likes

well the reason i didnt originally mark their post as solution is because thats not the solution i used…
I insead changed the strings and didnt use string.lower, although i probably could have

Then would you mind sharing the solution?

oh all i did was change the strings that was it, i maked their post thoguh dont worry. Sorry about that

Uhhh huh… Okay then.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.