Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] Interpolation in Double-quoted Strings

Interpolation is a special process whereby certain special strings written in ASCII are replaced by something different. In2.1.1 Single-quoted Strings, we noted that certain sequences in single-quoted strings (namely, \\ and \') were treateddifferently. This is very similar to what happens with interpolation. For example, in interpolated double-quoted strings, various sequences preceded by a `\' character act different.

Here is a chart of the most common of these:

String Interpolated As
`\\' an actual, single backslash character
`\$' a single $ character
`\@' a single @ character
`\t' tab
`\n' newline
`\r' hard return
`\f' form feed
`\b' backspace
`\a' alarm (bell)
`\e' escape
`\033' character represented by octal value, 033
`\x1b' character represented by hexadecimal value, 1b

  Published under the terms of the GNU General Public License Design by Interspire