Hello, I would like to use FindFirstChild(“Name”) but with ignoring the case.
Example : U have the string “Name” and in workspace, you have an instance named “nAmE”. I would like :FindFirstChild to find it anyways, ignoring case.
Thank you!
Hello, I would like to use FindFirstChild(“Name”) but with ignoring the case.
Example : U have the string “Name” and in workspace, you have an instance named “nAmE”. I would like :FindFirstChild to find it anyways, ignoring case.
Thank you!
Will need your own function. Pretty easy. Just go through all children/descendants, ignore casing via string.lower
.
local function find_first_child(instance, name, recursive)
local descendants = not recursive and instance:GetChildren() or instance:GetDescendants()
for _, descendant in ipairs(descendants) do
if descendant.Name:lower() == name:lower() then
return descendant
end
end
return nil
end
I do know I can do that but there’s no other way to only proceed with :FindFirstChild?
No there is not, you will need a custom function like the one I provided. Your use case seems very niche, so I see no reason to use the built-in api.