Why doesn't StringBuilder have IndexOf method?

前端 未结 4 1154
感动是毒
感动是毒 2020-12-10 11:14

I understand that I can call ToString().IndexOf(...), but I don\'t want to create an extra string. I understand that I can write a search routine manually. I just wonder why

4条回答
  •  伪装坚强ぢ
    2020-12-10 11:38

    Unfortunately, many of the methods implemented for String could have been implemented for StringBuilder but that was not done. Consider using extension methods to add what you care about.

提交回复
热议问题