Tag: c

ASCII Code Manipulation

While inspecting the ASCII table a little while ago, I noticed some interesting patterns in it, which can be used for string manipulation. It's important to understand the ASCII table, because it's the base of most encodings.

Note I'll be using C-like syntax in my examples, but I won't be taking advantage of C's characters, which convert stuff like 'a' into 97 (a's ASCII code).

For those who don't know what much about ASCII codes, I'll give you a quick introduction. ASCII stands for "American Standard Code for Information Interchange", which assigns certain numbers to certain common characters. Since computers can only work with numbers, every letter, or character of any sort, must have a number associated with it. ASCII assigns numbers to 128 different commonly used characters (although many of the non-print characters are no longer used for their original purpose).

Read more