StringBuilder displayList = new StringBuilder();我在displayList中添加了一些项目,但在我的代码中,我需要在displayList中搜索项目如何搜索添加到displayList中的项目,请让我知道
发布于 2010-08-21 22:24:10
在使用ToString方法将其转换为字符串之前,您无法进行搜索。
发布于 2010-08-21 22:51:37
StringBuilder displayList = new StringBuilder();
displayList.Append( "ABC" );
string toFind = "B";
if( displayList.ToString().Contains(toFind) ) {
//found it
}https://stackoverflow.com/questions/3537911
复制相似问题