String Find [HOW]

So let’s say I have couple strings like
“You and me”, “Youtube”, “Have you eat?”, “You are human”, “I am me”, “I like to play”, “You are crazy”.
How to make when i search keywords “You” it will print all strings that has word “You” or “you” like that strings above.
So it will print
“There are five strings that has keywords you : You and me, Youtube, Have you eat?, You are human, You are crazy”

I know like a term using string.find but I can only print if found the string that has “You” keyword, but how to make it print all strings that has You keyword?

Put all the strings in a table and iterate over them and check if they contain “you” with string.find()


local strings = {"you", "I", "this string contains you"}

for i, str in pairs(strings) do
    if string.find(str, "you") then

-- output: "you", "this string contains you"

But how to make it search all Instance name that has keywords You?

It’s literally the same thing. You should not be schematic because if you think a bit about it instead of putting the strings in a table you can iterate over the parts and check for “you” in their names

I think it’s the same right? Only like let’s say all instances in workspace u just need like this?

for i, ins in pairs(workspace.GetDescendants()) do
    if string.find(ins.Name, "you") then

Yes? If yes, then how to make even though there’s capital? Like maybe, YoU or YOu but they still search it? Because it’s same like “you”


for i, ins in pairs(workspace:GetDescendants()) do
    if string.find(string.lower(ins.Name), "you") then

also string.match cant detect capital and lower letters

Alright, thank you guys for giving me solution.