开发者

Searching an item from string builder object

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
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜