Character
07 FebruaryGet Unicode Value of Character in Java
In this post, we will see how to get unicode value of character in java. Get Unicode Value of Character in Java You can simply use below code to get unicode value of character in java. private static String getUnicodeCharacterOfChar(char ch) { return String.format("\\u%04x", (int) ch); } Here is complete example to print unicode value […]
04 MayConvert Character to ASCII Numeric Value in Java
Learn about how to convert Character to ASCII Numeric Value in Java.
30 SeptemberHow to compare characters in Java
Learn about how to compare characters in java using different methods.
17 MarchNew line character in java
In this post, we will see about new line character in java and how to add new line character to a String in different operating systems. [toc] Operating systems have different characters to denote the end of the line. Linux and new mac: In Linux, the end line is denoted by \n, also known as […]
09 OctoberFind Vowels in a String
In this post, we will see how to find and count vowels in a string. [toc] Find Vowels in a String If any character in String satisfy below condition then it is vowel and we will add it to Hashset. character==’a’ || character==’A’ || character==’e’ || character==’E’ || character==’i’ || character==’I’ || character==’o’ || character==’O’ […]
06 OctoberJava remove last character from string
Learn about how to remove last character from String in java using different ways.
06 OctoberConvert char to lowercase java
You can use Character class’s toLowerCase method to convert char to lowercase in java. Method signature public static char toLowerCase(char ch) Parameters ch is primitive character type. Return type return type is char. If char is already lowercase then it will return same. package org.arpit.java2blog; public class JavaToLowercaseMain { public static void main(String[] args) { […]
06 OctoberConvert char to uppercase java
You can use Charater class’s touppercase method to convert char to uppercase in java. Method signature public static char touppercase(char ch) Parameters ch is primitive character type. Return type return type is char. If char is already uppercase then it will return same. package org.arpit.java2blog; public class JavaToUpperCaseMain { public static void main(String[] args) { […]
06 OctoberJava isLetter method
Character class’s isletter method can be used to check if character is letter or not. Method signature public static boolean isLetter(char ch): Parameters ch is primitive character type. Return type boolean is primitive character type. package org.arpit.java2blog; public class JavaIsLetterMain { public static void main(String[] args) { System.out.println(Character.isLetter('a')); System.out.println(Character.isLetter('Y')); System.out.println(Character.isLetter('5')); System.out.println(Character.isLetter('&')); } } When you […]