Commit 7109c26
committed
feat: Print backslashes using escape sequences in Java [backslash-escape]
🔑 Key: backslash-escape
🧠 Logic:
- Demonstrates how to print a single backslash (`\`) using `\\` (escape sequence).
- Prints file paths and double backslashes explicitly using:
➤ `"C:\\Program Files\\Java"` → prints: C:\Program Files\Java
➤ `"\\\\"` → prints: \\
📘 Purpose:
- Helps in displaying Windows file paths and backslash literals.
- Essential in strings where backslashes are syntactically significant (regex, file paths).
💡 Tip:
- Each `\\` results in one `\` in the output.
Signed-off-by: Somesh diwan <[email protected]>1 parent 23cb018 commit 7109c26
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments