c# winform escape single quote in input code example Example: c# handle single quote inside string s = s.Replace("'", "\\'")