Escape sequence and hex number : Escape Characters « String « Ruby






Escape sequence and hex number


"\a" == "\x07"  # => true  #ASCII 0x07 = BEL (Sound system bell)
"\b" == "\x08"  # => true  #ASCII 0x08 = BS (Backspace)
"\e" == "\x1b"  # => true  #ASCII 0x1B = ESC (Escape)
"\f" == "\x0c"  # => true  #ASCII 0x0C = FF (Form feed)
"\n" == "\x0a"  # => true  #ASCII 0x0A = LF (Newline/line feed)
"\r" == "\x0d"  # => true  #ASCII 0x0D = CR (Carriage return)
"\t" == "\x09"  # => true  #ASCII 0x09 = HT (Tab/horizontal tab)
"\v" == "\x0b"  # => true  #ASCII 0x0B = VT (Vertical tab)

 








Related examples in the same category

1.Escape Characters list
2.Escape a single quote
3.Escape backslash
4.Put a string with control character
5.Check the length of a string which has the control character inside
6.Representing Unprintable Characters
7.Construct a string from hex value
8.String operation on escape char
9.Tab key in double quotation
10.Use Tab key in {}
11.use tab key in %Q{}
12.Tab key in single quotation mark
13.tab key in %q{}