Way to format all non whitespace characters from a string?

Is there a string specifier or other method of changing non whitespace characters? I want to maintain spaces but change other letters.
Example: Black Hole????? ????
Thanks!

1 Like

The %S specifier:

local str = "Convert everything here (other than whitespaces) to '?'"
str = str:gsub("%S", '?')

print(str) --> Every other than spaces are changed to '?'
1 Like