I am working on writing a method to remove a namespace from System.Type.FullName (not XML).
I started with googling and didn't go too far, so I switched to trying to write Regex, which I could use with Regex.Replace (). But I am far from a master of art in regular expression, so I humbly present myself to the gods of regular expressions.
Given the following inputs:
name.space.class name.space.class<other.name.space.class1> name.space.class<other.name.space.class1, shortSpace.class2>
I need to remove namespaces to get:
class class<class1> class<class1, class2>
Alternatively, if anyone knows about an existing library that has this functionality, all the better!
Note. . I know that System.Type has a Namespace property that I could use to remove a namespace (for example, System.Type.FullName - System.Type.Namespace), but my method accepts type name as a string and should work with type names which runtime does not know about (cannot decide).
source share