RegEx.IsMatch() vs. String.ToUpper().Contains() performance

前端 未结 3 677
深忆病人
深忆病人 2020-12-11 19:47

Since there is no case insensitive string.Contains() (yet a case insensitive version of string.Equals() exists which baffles me, but I digress) in

3条回答
  •  半阙折子戏
    2020-12-11 20:00

    I would expect RegEx.match to be slow based on personal experience with regular expression parsers in general. But as many folks have mentioned, profiling it is the best way to find out for sure. I've had to fix performance issues related to regular expression parsers, toLower and toUpper have never come back to bite me.

提交回复
热议问题