Answer the question
In order to leave comments, you need to log in
How to convert string str to type type?
Hello. There is a method
void Method(Type type, string str)
{
object o = (type)str;
}
I think it's clear from the line what I want to get. If not, I want to get a variable of type type by converting the string str to that type, if possible.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question