Java-lang-character-isisocontrol-codepoint
提供:Dev Guides
Java.lang.Character.isISOControl()メソッド
説明
- java.lang.Character.isISOControl(int codePoint)*は、参照される文字(Unicodeコードポイント)がISO制御文字かどうかを判断します。 文字が「\ u0000」から「\ u001F」の範囲または「\ u007F」から「\ u009F」の範囲にある場合、文字はISO制御文字と見なされます。
宣言
以下は* java.lang.Character.isISOControl()*メソッドの宣言です
public static boolean isISOControl(int codePoint)
パラメーター
*codePoint* -テストする文字(Unicodeコードポイント)
戻り値
このメソッドは、文字がISO制御文字の場合はtrueを返し、そうでない場合はfalseを返します。
例外
NA
例
次の例は、lang.Character.isISOControl()メソッドの使用法を示しています。
package com.finddevguides;
import java.lang.*;
public class CharacterDemo {
public static void main(String[] args) {
//create 2 int primitives cp1, cp2
int cp1, cp2;
//assign values to cp1, cp2
cp1 = 0x008f;
cp2 = 0x0123;
//create 2 boolean primitives b1, b2
boolean b1, b2;
//assign isISOControl results of cp1, cp2 to b1, b2
b1 = Character.isISOControl(cp1);
b2 = Character.isISOControl(cp2);
String str1 = "cp1 is an ISO control character is " + b1;
String str2 = "cp2 is an ISO control character is " + b2;
//print b1, b2 values
System.out.println( str1 );
System.out.println( str2 );
}
}
上記のプログラムをコンパイルして実行すると、次の結果が生成されます-
cp1 is an ISO control character is true
cp2 is an ISO control character is false