Answers for "c# where includes string or string"

C#
9

c# string contains

bool b = s1.Contains("myString");
Posted by: Guest on May-26-2020
0

check if string is in string

string stringToCheck = "text1";
string[] stringArray = { "text1", "testtest", "test1test2", "test2text1" };
foreach (string x in stringArray)
{
    if (x == stringToCheck)
    {
        // Process...
    }
}
Posted by: Guest on January-01-1970

C# Answers by Framework

Browse Popular Code Answers by Language