Java Character isMirrored() MethodThe isMirrored(char ch) method of Character class determines whether the given(or specified) character is mirrored as per the Unicode specification. The mirrored characters must have their glyphs horizontally mirrored so that when displayed in the text, they are from right-to-left. NOTE: The above method cannot be used to handle the supplementary characters. In order to handle the supplementary characters, we can use the isMirrored (int) method.SyntaxParametersch: It is the character that needs to be tested for the mirror property. Return ValueThe isMirrored(char ch)method returns a Boolean value, i.e., true if the given(or specified) character is mirrored. Otherwise, the method returns false. Example 1Output: Enter the first character:* The first input '*' is not mirrored. Enter the second character:[ The second input '[' is mirrored. Example 2Output: The first character '{' is a mirrored character: true The second character '^' is a mirrored character: false The third character '&' is a mirrored character: false Java Character isMirrored () MethodThe isMirrored(int codePoint) method of Character class determines whether the given(or specified) character is mirrored as per the Unicode specification. The mirrored characters must have their glyphs horizontally mirrored so that when displayed in the text, they are from right-to-left. SyntaxParameterscodePoint: It is the codePoint which is the character that needs to be tested. Return ValueThe isMirrored(int codePoint)method returns a Boolean value, i.e., true if the given(or specified) character is mirrored. Otherwise, the method returns false. Example 1Output: The first Codepoint '93' is mirrored The second codepoint '121' is not mirrored. The third codepoint '168' is not mirrored. The fourth codepoint '199' is not mirrored. Example 2Output: The first codePoint '3073' represents a mirrored character: false The second codePoint '60' represents a mirrored character: true The third codePoint '120' represents a mirrored character: false Example 3Output: Enter the first input:[ The character '[' is mirrored. Enter the second input:* The character '*' is not mirrored. Enter the third input:} The character '}' is not mirrored. Next TopicJava-character-isspace-method |