I have two strings for comparison
String Str1 = "A C";
String Str2 = "A B C";
Str2.Contains(Str1); //It will return False ,Contains append % at Start and End of string
//Replace space with %
Str1 = "%A%C%";
Str2 = "%A%B%C%";
Str2.Contains(Str1); //Want it to return True ,
We do have Contains,StartsWith,EndsWith
methods for comparison, But what my requirement is , if we compare str2 and str3 , it should return True , as it lies in Str2.
Can we achive such behaviour in C# ?I have done this in SQL but not getting some useful at C#.Any regex etc ?