I am converting a string to a datatype based on the another string that contains the name of datatype. I have two string like below:
string string_1 = "true";
string string_2 = "System.Boolean";
i need to convert the string 1 to the data type that is specified in string 2. how can i do that?(note that the string_2 can be each datatype) must i use if's for checking string_2 with any type of datatype?
Aucun commentaire:
Enregistrer un commentaire