How I may help
LinkedIn Profile Email me!
Call me using Skype client on your machine

Reload this page Programming Escape Characters

This page examines the nuances of escape characters used in C and Java program coding.

Sound: Pool balls breaking


Topics this page:

  • Escape Characters
  • End of Line Chars
  • Setting Escape Switch
  • Your comments???
  • Related:

  • Java Programming
  • Literal Data Types
  • Languages
  • Applications Development
  • On the web

    Site Map List all pages on this site 
    About this site About this site 
    Go to first topic Go to Bottom of this page

    Set screen Escape characters

      Description VB
      Hex Unicode


      Backspace vbBack 8 010 08 \u0008


      (Horizontal) Tab vbTab 9 011 09 \u0009


      New Line Feed (LF) vbLf
      10 012 0A \u000a


      Vertical Tab vbVerticalTab 11 013 0B \u000B


      Form Feed vbFormFeed 12 014 0C \u000c


      Carriage Return (CR) vbCr 13 015 0D \u000d


      Back slash (solidus) - 092 134 5C \u005c


      Single quote (grave accent) - 39 047 27 \u0027


      Double quote - 34 042 22 \u0022


      null (C string terminator) vbNullChar - -   \u0000


      null (Empty) string vbNullString 0 000 00 -


      continuation (UNIX)          


      Alert (beep/bell sound) or New line break for CSS2 content   7 7 07 \u0007


      Space   32 040 20  


      Escape   27 033 1B \u001B


      infinity(INF) - ? 236 EC \u221E

      See or

      PHP programs also need escaped dollars signs (which precede variable names), braces, and brackets (which have special meaning in PHP):
      \$ \{ \} \[ \]

      In DOS batch files, the character like the backslash in Linux is the carrot, which tells the command interpreter to see the next character as a conventional character. An example usage is this:

        @echo off
        set username=josh
        echo ^<^> >> emaillist.txt

    Go to Top of this page.
    Next topic this page

    Set screen End of Line characters

      Each platform has a different convention is for terminating lines:

      • On Unix, an ASCII newline (\n) LF (linefeed) character ends each line.
      • On Windows, an ASCII sequence CR LF (\r\n) (return followed by linefeed) ends each line.
      • On Macintosh, an ASCII CR (\r) (carriage return) character ends each line.

      Within UNIX, convert DOS newlines (CR/LF) to Unix format with this regular expression command:

        sed 's/.$//' file # assumes that all lines end with CR/LF

      Within DOS, convert Unix newlines (LF) to DOS \r\n format with one of these two regular expression commands:

        sed 's/$//' file # method 1
        sed -n p file # method 2

      tool Use this standard utility:

        dos2unix fromfile1 tofile

      tool Flip-xp.exe is a FREE command-line utility you can download to your Windows\System32 folder to display (-t) or convert ASCII files to Unix (-u) or to Windows (-d) or to Macintosh (-m).

    Go to Top of this page.
    Next topic this page

    Set screen Removing Trailing Characters

      Starting with Python 2.2, to remove all occurances of any line terminator from the end of the string S without removing other trailing whitespace:


      This is similar to Perl's chomp().

    Go to Top of this page.
    Next topic this page

    Set screen Setting Escape characters

      Oracleanother page on this site SQLPLUS recognizes the & ampersand character as a substitution character for data input.

      So to store a string such as "Johnson & Son" into an Oracle table, use an escape character, as in 'Johnson \& Son' (with the \&).

      But first turn on escape character processing:

      SQL> set escape \

    Go to Top of this page.
    Next topic this page

    Set screen Use in UNIX Shells

      UNIX Korn shells use the \c escape character to signal continuation (no automatic line break):

        echo "Enter the path to the data file: \c"

    Go to Top of this page.
    Next topic this page

    Portions ©Copyright 1996-2014 Wilson Mar. All rights reserved. | Privacy Policy |

    How I may help

    Send a message with your email client program Thank you!