How to get the object name only? (without the full namespace etc.)

  • Thread starter Thread starter ORC
  • Start date Start date
O

ORC

If I do this:
MyClass.ToString();
I e.g. get this:
MyApplication.Form1+MyClass

But how do I get the name of myclass alone?

Thanks
Ole
 
ORC said:
If I do this:
MyClass.ToString();
I e.g. get this:
MyApplication.Form1+MyClass

But how do I get the name of myclass alone?

Do you mean the object name (in which case there is no such thing) or
the type name? Note that the type name here is Form1+MyClass, as it's a
nested class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top