Hello,
The actual escape sequence characters are as follows...
\b
Matches a backspace
\t
Matches a tab
\r
Matches a carriage return
\v
Matches a vertical tab
\f
Matches a form feed
\n
Matches a new line
\e
Matches an escape
\040
Matches an ASCII character as octal (up to three digits);
\x20
Matches an ASCII character using hexadecimal representation (exactly
two digits).
\cC
Matches an ASCII control character; for example, \cC is control-C.
\u0020
Matches a Unicode character using hexadecimal representation (exactly
four digits).
Regards
Scott Blood
C# Developer
Stoitcho Goutsev (100) said:
Of course this will work. Putting @ infront of a string means that you
are not going to use escape sequences, so your string contains two
characters - \ and e.
sCal.ToCharArray()[0]) returns \ in this case which is not \e, whatever
this esc char must be.
--
Stoitcho Goutsev (100)
this seems to work ok...
string sCal = @"\e";
if (e.KeyChar == sCal.ToCharArray()[0])
{
this.Close();
}
Really weird.. problem
VJ
I am having a problem with the "escape" character \e. This code is in
my
Windows form KeyPress event. The compiler gives me "unrecognized
escape
sequence" even though this is documented in MSDN. Any idea if this is
a bug?
if (e.KeyChar == '\e')
{
this.Close();
}