website/content/blog/2017-08-28-escape-sequences-java.md
2020-01-15 21:51:49 -05:00

96 lines
No EOL
1.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 2236
title: Escape Sequences in Java
date: 2017-08-28T17:12:00+00:00
author: Brandon Rozek
layout: post
guid: https://brandonrozek.com/?p=2236
permalink: /2017/08/escape-sequences-java/
medium_post:
- 'O:11:"Medium_Post":11:{s:16:"author_image_url";N;s:10:"author_url";N;s:11:"byline_name";N;s:12:"byline_email";N;s:10:"cross_link";N;s:2:"id";N;s:21:"follower_notification";N;s:7:"license";N;s:14:"publication_id";N;s:6:"status";N;s:3:"url";N;}'
mf2_syndicate-to:
- 'a:1:{i:0;s:4:"none";}'
mf2_cite:
- 'a:4:{s:9:"published";s:25:"0000-01-01T00:00:00+00:00";s:7:"updated";s:25:"0000-01-01T00:00:00+00:00";s:8:"category";a:1:{i:0;s:0:"";}s:6:"author";a:0:{}}'
tumblr_post_id:
- "164716848139"
tumblr_crosspostr_crosspost:
- 'N'
kind:
- note
---
Sometimes you want to format your outputs. This is a quick cheatsheet containing the differerent escape sequences
 
<table class="tg">
<tr>
<th class="tg-yw4l">
Character
</th>
<th class="tg-yw4l">
Escape Sequence
</th>
</tr>
<tr>
<td class="tg-yw4l">
Newline
</td>
<td class="tg-yw4l">
\n
</td>
</tr>
<tr>
<td class="tg-yw4l">
Tab
</td>
<td class="tg-yw4l">
\t
</td>
</tr>
<tr>
<td class="tg-yw4l">
Backspace
</td>
<td class="tg-yw4l">
\b
</td>
</tr>
<tr>
<td class="tg-yw4l">
Double Quote           
</td>
<td class="tg-yw4l">
\&#8221;
</td>
</tr>
<tr>
<td class="tg-yw4l">
Single Quote
</td>
<td class="tg-yw4l">
\&#8217;
</td>
</tr>
<tr>
<td class="tg-yw4l">
Backslash
</td>
<td class="tg-yw4l">
\\
</td>
</tr>
</table>