Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how would i remove a certain characters from a string?

So i want to remove certain characters from a string, here's an example of what i need to do:

string:

**'h*e*l*l*o*'**

(had to put that there because the post was glitching)

i want to remove all the '*' characters from the above string:

edited string: 'hello'

if there is a way to do this please let me know, thanks!

1 answer

✓ Accepted answer

To do this you can use string.gsub which will pass back a copy of the string with the occurrences of the pattern given removed along with the number of matches made.

Example:-

string.gsub([some string], '%*', '') -- this will match only *

String pattern are used to define what a match is.

I hope this helps.

This discussion is preserved as it was. New answers, comments, and votes are closed.