.Net Parse versus Convert

后端 未结 5 506
失恋的感觉
失恋的感觉 2020-12-17 16:23

In .Net you can read a string value into another data type using either .parse or Convert.To.

I\'m not fam

5条回答
  •  悲&欢浪女
    2020-12-17 17:20

    Here's an answer for you:

    http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=77428

    Though I think in modern versions of .NET, the best thing to do is use TryParse in any case, if there's any doubt that the conversion will work.

提交回复
热议问题