What escape sequences does C# support?

PHPz
Release: 2023-09-04 16:53:02
forward
911 people have browsed it

C# 支持哪些转义序列?

The following example shows how to display some escape characters in C# -

Example

using System;
using System.Collections.Generic;

class Demo {
   static void Main() {

      Console.WriteLine("Warning!" + '\u0007');

      Console.WriteLine("Test \t Demo Text");

      Console.WriteLine("This is it!This is on the next line!");
   }
}
Copy after login

For the complete list of escape sequences in C# −

##match newline character,\u000A . \rmatch escape character,\u001B . \e
Escape character Description Pattern
\a Matches the bell character, \u0007. \a
\b In character class, matches the backspace character, \u0008. [\b]{3,}
\t matches tab character, \u0009. (\w )\t
\r matches the carriage return character, \u000D. (\r is not equivalent to newline character,

)

\r

(\w )

\v matches the vertical tab character, \u000B. [\v]{2,}
\f matches the form feed character, \u000C. [\f]{2,}

(\w )

\e

The above is the detailed content of What escape sequences does C# support?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!