Answers for "you have the following c# code. sb is a a very long string. you need to identify whether a string stored in an object named stringtofind is within the stringbuilder sb object. which code should you use?"

C#
0

you have the following c# code. sb is a a very long string. you need to identify whether a string stored in an object named stringtofind is within the stringbuilder sb object. which code should you use?

stringtofind = "this is a string to find";
if (sb.indexof(stringtofind) > -1)
{
    //string found
}
else
{
    //string not found
}
Posted by: Guest on January-11-2022

Code answers related to "you have the following c# code. sb is a a very long string. you need to identify whether a string stored in an object named stringtofind is within the stringbuilder sb object. which code should you use?"

C# Answers by Framework

Browse Popular Code Answers by Language