ตัวอย่างการแสดง Escape Characters
using System;
using System.Collections.Generic;
class Demo
{
static void Main()
{
Console.WriteLine("Warning!" + '\u0007'); // Bell
Console.WriteLine("Test \t Demo Text"); // Tab
Console.WriteLine("This is it!\nThis is on the next line!"); // New line
}
}
ตาราง Escape Sequences หลัก
| Escape Character | คำอธิบาย | Pattern |
| \a | Bell (\u0007) | \a |
| \b | Backspace (\u0008) | [\b]{3,} |
| \t | Tab (\u0009) | (\w+)\t |
| \r | Carriage Return (\u000D) | \r\n(\w+) |
| \v | Vertical Tab (\u000B) | [\v]{2,} |
| \f | Form Feed (\u000C) | [\f]{2,} |
| \n | New Line (\u000A) | \r\n(\w+) |
| \e | Escape (\u001B) | \e |