我知道我可以调用toString()。的IndexOf(...),但我不希望创建一个额外的字符串。我知道我可以手工编写一个搜索程序。我不知道为什么这样一个例程不已经在框架存在。
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 such a routine doesn't already exist in the framework.
不幸的是,许多实施了字符串的方法可能已实施的StringBuilder但是却没有这样做。考虑使用扩展方法来添加你所关心的事情。
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.