Last Updated : 06 Dec, 2018
public static boolean isIdentifierIgnorable(char ch)Parameters: The parameter ch is of character datatype and refers to the character that is to be tested. Return Value: This method returns true if the character is an ignorable control character that may be part of a Java or Unicode identifier, false otherwise. Below programs illustrate the Character.isIdentifierIgnorable(char ch) method: Program 1: Java
// Java program to illustrate
// Character.isIdentifierIgnorable(char ch) method
import java.lang.*;
public class gfg {
public static void main(String[] args) {
// Creates 2 character primitives c1, c2 and assigning values
char c1='\u0000', c2= '9';
// Assigns isIdentifierIgnorable results of
// c1, c2 to boolean primitives
boolean bool1 = Character.isIdentifierIgnorable(c1);
boolean bool2 = Character.isIdentifierIgnorable(c2);
String str1 = "c1 is an ignorable control character is " + bool1;
String str2 = "c2 is an ignorable control character is " + bool2;
System.out.println( str1 );
System.out.println( str2 );
}
}
Output:
c1 is an ignorable control character is true c2 is an ignorable control character is falseProgram 2: Java
import java.lang.*;
public class gfg {
public static void main(String[] args) {
// Create 2 character primitives c1, c2 and assigning values
char c1='\u000E', c2= '8';
// Assigns isIdentifierIgnorable results of
// c1, c2 to boolean primitives
boolean bool1 = Character.isIdentifierIgnorable(c1);
boolean bool2 = Character.isIdentifierIgnorable(c2);
String str1 = "c1 is an ignorable control character is " + bool1;
String str2 = "c2 is an ignorable control character is " + bool2;
System.out.println( str1 );
System.out.println( str2 );
}
}
Output:
c1 is an ignorable control character is true c2 is an ignorable control character is false
public static boolean isIdentifierIgnorable(int codePoint)Parameter: The function accepts a single parameter codePoint of integer datatype which specifies the character (Unicode code point) that is to be tested. Return value: This method returns true if the character is an ignorable control character that may be part of a Java or Unicode identifier, false otherwise. Below program illustrates the Character.isIdentifierIgnorable(int codepoint) method: Program 1: Java
// Java program to demonstrate
// the Character.isIdentifierIgnorable(int codepoint) method
import java.lang.*;
public class gfg {
public static void main(String[] args) {
// Integer primitives c1, c2
int c1 = 0x019f, c2 = 0x1abc;
// Assign isIdentifierIgnorable results of cp1, cp2
// to boolean primitives bool1, bool2
boolean bool1 = Character.isIdentifierIgnorable(c1);
boolean bool2 = Character.isIdentifierIgnorable(c2);
// Print bool1, bool2 values
System.out.println( "c1 is an ignorable control character?"+
" ans is "+bool1);
System.out.println( "c2 is an ignorable control character?"+
" ans is "+bool2);
}
}
Output:
c1 is an ignorable control character? ans is false c2 is an ignorable control character? ans is falseProgram 2: Java
// Java program to demonstrate
// the Character.isIdentifierIgnorable(int codepoint) method
import java.lang.*;
public class gfg {
public static void main(String[] args) {
// Integer primitives c1, c2
int c1 = 0x119f, c2 = 0x0abc;
// Assign isIdentifierIgnorable results of cp1, cp2
// to boolean primitives bool1, bool2
boolean bool1 = Character.isIdentifierIgnorable(c1);
boolean bool2 = Character.isIdentifierIgnorable(c2);
// Print bool1, bool2 values
System.out.println( "c1 is an ignorable control character?"+
" ans is "+bool1);
System.out.println( "c2 is an ignorable control character?"+
" ans is "+bool2);
}
}
Output:
c1 is an ignorable control character? ans is false c2 is an ignorable control character? ans is false
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4