C# 类型转换

覃榜言

关注

阅读 113

2022-07-14

string转其他
string转double

参考链接:

  • double.Parse(): static Double Parse(string s)
  • Convert.ToDouble(): static double ToDouble(string value)
  • double.TryParse(): static bool TryParse(string s, out Double result)
string转int

参考链接:

  • int.Parse()
  • Convert.ToInt32()
  • int.TryParse()
  • (int)
cast转换?

参考链接:​​https://www.nhooo.com/note/qa07w4.html​​

强制转换和类型转换

参考链接:​​https://docs.microsoft.com/zh-cn/dotnet/csharp/programming-guide/types/casting-and-type-conversions​​

橘子Jane



精彩评论(0)

0 0 举报