StringBuilder displayList = new StringBuilder();
I have added a few items in displayList but in my code i need to search for an item in displayList how can i search an item added开发者_如何学Python to displayList please let me know
You can't search until you convert it to string using the ToString
method.
StringBuilder displayList = new StringBuilder();
displayList.Append( "ABC" );
string toFind = "B";
if( displayList.ToString().Contains(toFind) ) {
//found it
}
精彩评论