I want to use gsub in a text to change a exact string.
local Text = "Here is an apple and there is a pineapple."
local NewText = Text:gsub("apple","grape")
print(NewText)
--Output
--Here is an grape and there is a pinegrape.
It change pineapple to pinegrape and I do not want that to happen.

2 comments
WHat do you exactly want to happen XD?
This will change every word that reads as "apple" to grape. For a solution, you could use a gmatch to rule out non-singular worded versions instead to solve your issue.