String comparison performance in C#

后端 未结 10 1646
一向
一向 2020-12-20 11:42

There are a number of ways to compare strings. Are there performance gains by doing one way over another?

I\'ve always opted to compare strings like so:



        
10条回答
  •  别那么骄傲
    2020-12-20 12:08

    There was a pretty similar question recently regarding the fastest way to trim a string, but it was basically benchmarking the different ways of comparing them.

    You can check out the benchmarks on this post.

提交回复
热议问题