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

Is there something I can do in string to make sure it contains letters/numbers and not just spaces?

I was wondering if there is anything I can do with a string to make sure that a player has entered letters/numbers and not just put a bunch of spaces.

1 answer

Keep in mind, this is not a request site. You can easily look this stuff up. string.gsub is what you're looking for I believe. This will remove all whitespace. I found this example over a quick google search:

local function RemoveSpaces(str)
    return str:gsub(" ","")
end

Read about Strings here.

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