How quickly can you remove spaces from a string?
This code will work on all UTF-8 encoded strings… which is the bulk of the strings found on the Internet if you consider that UTF-8 is a superset of ASCII.Note that the first set of code (and possibly the rest), only work as the space, newline, and carriage return are the 7 bit ASCII set is included in UTF-8.  However, the extended 8-bit ASCII set is not, but is often included when people speak of ASCII.  So for example, if the request was to remove all "Copyright Sign" symbols, which is U00A9, it would not work correctly.  The UTF-8 encoding for this symbol is 0xC2 0xA9, but the code only works on individual bytes, so it would remove the A9 byte, leaving a C2 byte and then whatever byte came next.  Additionally, it would hit other UTF-8 characters like the "Greek Capital Letter Omega" (Ω which is encoded in UTF-8 as 0xCE 0xA9)tl;dr
Only works for the 7-bit ASCII set, but not the common extended 8-bit ASCII sets