📌  相关文章
📜  stringbuilder sb = new stringbuilder(reallylongstring);您需要确定存储在名为 stringtofind 的对象中的字符串是否在 stringbuilder sb 对象中. - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:05.937000             🧑  作者: Mango

代码示例1
StringBuilder sb = new StringBuilder();

sb.Append("This is the start of a very long string. ");
sb.Append("It just gets longer and longer. ");
sb.Append("When will this end?");
sb.Append("No one knows.");
sb.Append("Can you find the Banana in this string. ");
sb.Append("Only you can find it and save the world. ");
sb.Append("Now go and bring back the results.");

Boolean result = sb.ToString().Contains("Banana");