Partial rename iterator

I have parts with names that contain a keyphrase, like apple.
I want to do an iterator of a model of these parts

for i,v in ipairs(model:GetDescendants()) do
  if v:IsA("Basepart") and [TODO] then
    v.Name = [TODO]
  end
end

and rename them the same, just with any detected to have a keyphrase, be named with a different phrase like pear in place of any previous such as the example apple segment.

Here’s what I ended up doing:

local model = workspace.rename

local find = "apple"
local replace = "pear" 

for i,v in ipairs(model:GetDescendants()) do
  local X = string.find(string.lower(v.Name),find)
  if v:IsA("BasePart") and X then
    v.Name = string.sub(v.Name,1,X-1)..replace.. string.sub(v.Name,X+string.len(find),-1)
  end
end

--Ex: "applecool" -> "pearcooL"

using the string | Documentation - Roblox Creator Hub API

It could also be done in Strings | Documentation - Roblox Creator Hub, but it would less approachable in my opinion.