Lesson five, T language escape character () (version 5.0)

Source: Internet
Author: User
Escape character

String values are not limited, in quotation marks "" can be filled: numbers, Chinese, letters, special characters, and their combination, the value of the string should be extended with double quotation marks, such as "I am a character type", of course, some people will ask, if the string to take "number, how to deal with, is" "", not, This compile will be syntax error, TC Comprehensive development tool will be the front two "" as a string, after that ", the syntax error, this time you need to escape the character, the following we introduce the escape character, general application not to it

If we want to say "," This is wrong, should write "\" ", this is to represent a string, inside the value is only one"

The escape character of the TC, which we listed here are several more commonly used:

1, \ "escaped double quotes (" _\ "abc\" _\ "efg\" _ ", with the MessageBox output _" ABC "_" EFG "_)

2, \ ' escaped single quotation mark ("_\ ' abc\ ' _\" efg\ ' _ ", with the MessageBox output _ ' ABC ' _ ' EFG ' _)

3, \ \ Escape the slash ("C:\\tc", with the MessageBox output C:\TC, if here only with a single slash will become a tab \ t, it is not the path we want)

4, \ n carriage return ("123\n456", with MessageBox output 123
456, this is the auto-wrap.)

5, \ r newline character ("123\r456", with MessageBox output 123
456, this is the auto-wrap.)

6, \ t escape tab ("123\t456", where the string is equal to 123 456, the middle will replace \ t to 4 spaces)

When using "\ r" or "\ n" alone, we can use "\ r \ n" to handle

Lesson five, T language escape character () (version 5.0)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.