Character.isISOControl() in Java

Character.isISOControl(): This method is available in java.lang.Character class of Java.

Approach 1: When the argument of type char.

Syntax:

boolean java.lang.Character.isISOControl(char ch)

This method takes one argument of type char as its parameter. This method determines if the specified character is an ISO control character. A character is considered to be an ISO control character if its code is in the range '\u005Cu0000'through '\u005Cu001F' or in the range '\u005Cu007F' through '\u005Cu009F'.

Parameters: One parameter is required for this method.

ch: the character to be tested.

Returns: true if the character is an ISO control character; false otherwise.

Exceptions: NA

Java

public class CharacterisISOControlchar {
    public static void main(String[] args) {

        char ch = 'a';
        System.out.println(Character.isISOControl(ch));
    }
}

Output:

false


Approach 2: When the argument of type int.

Syntax:

boolean java.lang.Character.isISOControl(int codePoint)

This method takes one argument of type int as its parameter. This method determines if the referenced character (Unicode code point) is an ISO control character. A character is considered to be an ISO control character if its code is in the range '\u005Cu0000'through '\u005Cu001F' or in the range '\u005Cu007F' through '\u005Cu009F'.

Parameters: One parameter is required for this method.

codePoint: the character (Unicode code point) to be tested.

Returns: true if the character is an ISO control character; false otherwise.

Exceptions: NA

Java

public class CharacterisISOControlint {
    public static void main(String[] args) {

        int codePoint = 14;
        System.out.println(Character.isISOControl(codePoint));
    }
}

Output:

true

No comments:

Post a Comment