Is there an invisible character that is not regarded as whitespace?

Try Unicode Character 'ZERO WIDTH SPACE' (U+200B). It is not a Whitespace according to WP: Whitespace#Unicode

The code of StringUtils.isBlank will not bother it:

public static boolean isBlank(String str) {
int strLen;
if (str == null || (strLen = str.length()) == 0) {
          return true;
     }
for (int i = 0; i < strLen; i++) {
     if ((Character.isWhitespace(str.charAt(i)) == false)) {
                   return false;
                }
         }
 return true;
  }

There's also (U+2800 BRAILLE PATTERN BLANK), which is a blank Braille block rather than a space character.


That Unicode Character 'ZERO WIDTH SPACE' (U+200B) Michael Konietzka shared didn't work for me, but found a different one that did:

‏‏‎ ‎

It actually identifies as combination of

U+200F : RIGHT-TO-LEFT MARK [RLM]
U+200F : RIGHT-TO-LEFT MARK [RLM]
U+200E : LEFT-TO-RIGHT MARK [LRM]
U+0020 : SPACE [SP]
U+200E : LEFT-TO-RIGHT MARK [LRM]

and it's ASCII value is 8207

‏‏‎'‏‏‎ ‎'.charCodeAt(0) // 8207

Source: http://emptycharacter.com/


JavaScript's

String.fromCharCode(8287).repeat(30)

gave me real but invisible spaces.

http://emptycharacter.com/ great