string s = @"abc\12345"; int x= s.IndexOf('\\'); int y=x; bool x1 = s.Contains('\\'); bool y1 = x1;
string input = "abcd\cdef\efg\ijk\lmn"; string[] splitString = input.split('\'); string result = splitString[0].Trim();
string your_String = "[StringValue]"; if (your_String.IndexOf('\\') >= 0) { // String Contains '\' sign } else { // String Does not Contain '\' sign }
string str = "Some text"; if (str.IndexOf('\\') != -1) { Console.WriteLine("Contains backslash."); } else { Console.WriteLine("Does not contain backslash."); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)