Change the qouted text rich text color?

Hello Developers

How to change the single qoute text color? using string.format()? or anything else? like
The user answer: "string"
The script return: <font color="(Some color)">string</font>

To further explain more, For instance like this:

The user typed string: **Bold Text**
script return: <b>Bold Text</b>

I already saw a thread like this, the ** to <b> long time ago but i never seen it again. i tried searching it<b> to ** roblox studio but it instead removed the <b> to **, aka google made it to just “roblox studio”. Thanks!

what i need is, like replacing the **text** to <b>text</b>. What it did is

image
image

To achieve your second example you’d do the following.

local oldText = "**Bold text.** Normal text."
local newText = oldText:gsub("%*%*(.*)%*%*", "<b>%1</b>")
print(newText) --<b>Bold text.</b> Normal text.

image

To achieve your first example you’d do the following.

local oldText = "string"
local newText = oldText:gsub("^", "<font color=\"#000000\">") --Black.
newText = newText:gsub("$", "</font>")
print(newText) --<font color="#000000">string</font>

image