Naimish Makwana

Naimish Makwana

  • 140
  • 13.5k
  • 184.1k

Generic method which return datatype from string value

Jan 19 2023 4:34 AM

I want to create a Method which will return the Data Type based on string parameter. 

EX. If I pass.

“Test” → return string

“10” → return int

“10.10” → return decimal

“9245fe4a-d402-451c-b9ed-9c1a04247482” → return GUID.

Thanks


Answers (8)