Home News DOC Class DL Others Cooker
Documents  >  Reference  >  escapesequence
escape sequence

escape sequence

The escape sequence is to express the special character and function which cannot be expressed in the usual character by a special character sequence.

Normally, the language system is to define the respective escape sequences, it is possible to embed the special characters and functions in a string.

For example, in C#,

string tab = "\t";

This is a string which express the tab. The \ is a special character for escape sequence.

There is no escape sequence in the Rice.

There is no escape sequence in the Rice. Therefore, it is not necessary to escape the characters other than the double quotes.

Because the double quotes is a symbol to express the string itself, it cannot be directly used in the string. Also, the control caracters like new line and tab can not use explicitly.

If those special character is needed, it create a string by the replacement or concatenation.

For example, when the tab is needed in the string.

string tab = "@This is a string.".Replace("@", "".TAB);

To create as above.

In the above example, @ is replaced by the tab.

Copyright © Rice All rights reserved.