相关疑难解决方法(0)

解析性能(如果,TryParse,Try-Catch)

我对处理解析文本信息的不同方法了解很多.例如,对于解析整数,可以期望什么样的性能.我想知道是否有人知道这方面的任何好的统计数据.我正在寻找一些经过测试的人的真实数字.

在哪些情况下,哪些提供最佳性能?

Parse(...)  // Crash if the case is extremely rare .0001%

If (SomethingIsValid) // Check the value before parsing
    Parse(...)

TryParse(...) // Using TryParse

try
{
    Parse(...)
}
catch
{
    // Catch any thrown exceptions
}
Run Code Online (Sandbox Code Playgroud)

c# parsing text

31
推荐指数
3
解决办法
1万
查看次数

标签 统计

c# ×1

parsing ×1

text ×1