At nescala Matthias suggested there was a faster way to check for possible whitespace characters using bitwise logic. We should look into that.