Here’s an ASCII cheat sheet:
ASCII Characters
- ASCII stands for American Standard Code for Information Interchange.
- It represents characters using numbers from 0 to 127.
- Basic ASCII characters include letters, digits, punctuation, and control characters.
Common ASCII Values
Decimal | Character | Decimal | Character |
---|---|---|---|
32 | Space | 65 | A |
48-57 | 0-9 | 97-122 | a-z |
58-64 | Punctuation | 123-126 | Special Characters |
Control Characters
Decimal | Character | Description |
---|---|---|
0 | NUL | Null |
7 | BEL | Bell |
8 | BS | Backspace |
9 | TAB | Horizontal Tab |
10 | LF | Line Feed (New Line) |
13 | CR | Carriage Return |
Extended ASCII
- Extends the basic ASCII set to include values from 128 to 255.
- Used for special characters, symbols, and additional characters.
ASCII Art
- ASCII art is a form of creative expression using ASCII characters.
- Example:
_______________
| ASCII Art |
| is fun! |
|_______________|
Conversion
Convert between characters and ASCII values in programming languages:
In Python:
char = 'A'
ascii_value = ord(char)
print(f'The ASCII value of {char} is {ascii_value}')
In JavaScript:
let char = 'A';
let asciiValue = char.charCodeAt(0);
console.log(`The ASCII value of ${char} is ${asciiValue}`);