Change "." text input to "%."

Hello, I am trying to make a search bar where it could detect a period input (.) and change it to (%.) so it would search strings that has a period on it. Any suggestions?

You can use string.gsub:

local function sub(str : string) : string
    local formatted, _ = string.gsub(str, "%.", "%%")
    return formatted
end
1 Like

Nevermind, I just found out that it can detect periods just by using (%.) as the matching string.

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