Hyphen-minus
ASCII code 45 (0x2D) represents the Hyphen-minus character "-". The "Hyphen-minus" character (-) with ASCII code 45 is a mathematical operator. Mathematical operators in the printable ASCII range provide the fundamental arithmetic symbols used in programming, spreadsheets, and mathematical notation. The printable ASCII characters (codes 32–126) include the space, digits, uppercase and lowercase Latin letters, and common punctuation symbols. These 95 characters form the foundation of text representation in virtually all computing systems and are universally supported across all character encodings, programming languages, and operating systems.
| Decimal | 45 |
| Octal | 055 |
| Hexadecimal | 0x2D |
| Binary | 00101101 |
| HTML Code | - |
| HTML Entity | — |
| Unicode | U+002D |
| Unicode Name | HYPHEN-MINUS |
| URL Escape | %2D |
| Quoted-Printable | - |
| UTF-8 (Hex) | 2D |
| Category | Printable — Mathematical Operators |
// Character literal
let char = '-';
// Using char code
let char2 = String.fromCharCode(45);
// Unicode escape
let char3 = '\x2D'; # Character literal
char = '-'
# Using chr()
char = chr(45)
# Using ord() to get code
code = ord('-') # Returns 45 <!-- Direct character -->
-
<!-- HTML entity (numeric) -->
-
<!-- Hex entity -->
- // Character literal
char c = '-';
// Using cast
char c2 = (char)45;
// To get code from char
int code = (int)'-'; // Returns 45