I'm currently trying to write a RegexReplace to ensure an input can be used as a valid XML-tag, meaning: no spaces, no special characters, only lowercase, etc...
Is there a common approach to that or do I have to do it all from scratch?
Example:
string Invalid = "asd(%4 asKUd n!%mn &§a_As1"; // Invalid as a tag
string Valid = FormatToSafeXmlTag(Invalid); // How to write this function?
// Valid = "asd4_askud_nmna_as1"