How do I search a string for special characters in an Editable Textbox

I’m making a textbox for players to enter a file location or file name for a screenshot or video they have captured during gameplay.

The plan is this:

  • Player enters their string
  • If ANY part of the string contains a character that’s not allowed an error message appears
  • If the text is committed with illegal characters it reverts to the last legal string (i have the set last valid text set up)

I’ve tried quite a few things. I know how to set and clear error boxes/string and revert to a previous string but I need the logic to be able to check that the character entered is illegal with each character typed and if one character is illegal it doesn’t matter if the rest of the string is fine, it will revert to the last legal string on committing the entry.


Something like this will work. You might need to check also if they enter if the string doesn’t have any illegal characters. (Not sure if Editable Text in UGM has some build-in function for illegal characters.)

Absolute legend thank you so much! This did the job perfectly :slight_smile: