.Net Parse versus Convert

后端 未结 5 500
失恋的感觉
失恋的感觉 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条回答
  •  萌比男神i
    2020-12-17 17:21

    There is also the DirectCast method which you should use only if you are sure what the type of the object is. It is faster, but doesn't do any proper checks. I use DirectCast when I'm extracting values from a loosely typed DataTable when I know the type for each column.

提交回复
热议问题