Java Character isIdentifierIgnorable() Method

The isIdentifierIgnorable(int codePoint) method of Character class generally determines whether the specified character can be considered as an ignorable character in Java or a Unicode identifier.

The following characters are considered as ignorable characters in Java or Unicode identifier:

  • ISO control characters which do not have whitespace.
  • All the characters which are having FORMAT general category value.

Syntax

Parameter

The above method requires only one parameter:

a.)The codePoint which is the character that needs to be tested.

Return Value

The isIdentifierIgnorable(int codePoint) method returns a boolean value, i.e., true if the given(or specified) character is an ignorable control character that may be part of Java or Unicode identifier. Otherwise, this method returns false.

Example 1

Output:

The first codePoint is an ignorable control character is:  true
The second codePoint is an ignorable control character is: false
The third codePoint is an ignorable control character is:  false

Example 2

Output:

The first codePoint is an ignorable control character:  false
The second codePoint  is an ignorable control character: false

Java Character isIdentifierIgnorable() Method

The isIdentifierIgnorable(char ch) method of Character class generally determines if the specified character can be considered as an ignorable character in Java or a Unicode identifier.

The following characters are considered as ignorable characters in Java or Unicode identifier:

  • ISO control characters which do not have whitespace.
  • All the characters which are having FORMAT general category value.

Note: The above method cannot be used to handle supplementary characters. In order to support all the Unicode characters, including the supplementary characters, we can use the isIdentifierIgnorable(int codePoint) method.

Syntax

Parameter

The above method requires only one parameter:

a.)The character which needs to be tested.

Return Value

The isIdentifierIgnorable(char ch) method returns a boolean value, i.e., true if the given(or specified) character is an ignorable control character and also which is a part of Java or Unicode identifier. Otherwise, this method returns false.

Example 3

Output:

The first character  'A' is an ignorable control character :  false
The second character 'B' is an ignorable control character : false
The third character  'C' is an ignorable control character :  false

Example 4

Output:

The first character  '1' is an ignorable control character :  false
The second character '2' is an ignorable control character :  false
The third character  '3' is an ignorable control character :  false

Example 5

Output:

Enter the first input of your choice:G
The character 'G' is an ignorable character : false
Enter the second input of your choice:#
The character '#' is an ignorable character : false