How to filter out RichText from a string?

To make it simple, I have a textbox where the user writes their code, the keywords are then rendered in with richtext to be a different colour, but it would cause problems if the player backspaced and deleted the rich text formating, which wouldn’t get re-formatted as the keyword isn’t strictly what it should be.

Basically my system right now is:

line inputformatting algorithmnline output

What I need it to be:

line inputrich text filteredformatting algorithmnline output

4 Likes

If you want the text without the tags as a string use the ContentText property of UI text elements.

6 Likes

does .CursorPosition and .selectionStart ignore rich text too?

1 Like

also another question, how to prevent the player from deleting certain parts of the rich text which then shows it

bumping because i still havent found an issue to the problem above

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.