System.TermInfoReader.Escape C# (CSharp) Method

Escape() static private method

static private Escape ( string s ) : string
s string
return string
		internal static string Escape (string s)
		{
			StringBuilder sb = new StringBuilder ();
			for (int i = 0; i < s.Length; i++) {
				char current = s [i];
				if (Char.IsControl (current)) {
					sb.AppendFormat ("\\x{0:X2}", (int) current);
				} else {
					sb.Append (current);
				}
			}

			return sb.ToString ();
		}
	}