I am trying to assign the HttpResponseMessage.Version with the value of "1.07" (actually it's a value that service returns. It's not a fixed value. This is just an example value.) and I tried using the below code but it returns the value as 1.7 .
string input = "1.07"
Version ver = null;
if (Version.TryParse(input, out ver))
Console.WriteLine("Converted '{0} to {1}.", input, ver);
I think it's the behavior of the Version class , but is there any work around for this problem ?
The problem is the HttpResponseMessage.Version only takes the version data type value.If I convert that to string, again converting it back to the version datatype is ignoring that leading zero.