Fastest way to trim a string and convert it to lower case

后端 未结 5 1286
情歌与酒
情歌与酒 2021-01-17 09:42

I\'ve written a class for processing strings and I have the following problem: the string passed in can come with spaces at the beginning and at the end of the string.

5条回答
  •  迷失自我
    2021-01-17 10:38

    If the strings use only ASCII characters, you can look at the C# ToLower Optimization. You could also try a lookup table if you know the character set ahead of time

提交回复
热议问题