Removing a certain part of a string and exchanging place with new text

I have my own filetype which i’d like to decode in a simple way but i need help
how can i cut a way a part of a string and add a new thing instead

1 = xR§
2 = ¶U

3 =
4 = �m~
5 = c�
6 = 0Z
7 = |
8 = w
9 = �Z_
0 = �

Example:

_xR§¶U_ = 123

so step by step would sort of be
_xR§¶U_
1¶U_
12
123

Thanks

Simpler way could be

local newstring = (“robloxian”)

local string = (“hello, world”)

then removing “world” and adding robloxian at “world” place instead
so it’d be
newstring = ("hello, “robloxian”)

String replacement can be achieved like this:

local originalString = "Hello World!"
local newString = string.gsub(originalString, "Hello", "Goodbye")
print(newString) --> Goodbye World!

See string | Roblox Creator Documentation and possibly also String Patterns for more information

2 Likes