CORE API / CATATAN</>↗Core API28 Jan 2006
To get the length of a String object we can use the String.length() method. This method returns the string length as an int value. The length of the string is equals to the length of the sequence of characters represented by this string object, and it is equals to the number of 16-bit Unicode characters […]
CORE API / CATATAN</>↗Core API25 Jan 2006
To compare strings for their content equality we must use the String.equals() method. This method ensures that it will compare the content of both string instead of the object reference of the both string. This method returns true if both string in comparison have the same content. Do not, never, use the == operator to […]
CORE API / CATATAN</>↗Core API24 Jan 2006
In this code example we are going to learn how to find a specific word or text inside a string. For this example we will utilize the java.lang.String class. The String class provides a method called String.indexOf(). It takes an argument of a String, which is the sub string that we want to find in […]
CORE API / CATATAN</>↗Core API20 Jan 2006
In the previous example How do I know if a character is lowercase?, we’ve learned how to use the Character.isLowerCase() method. Now we will learn how to use the other method, which is the Character.isUpperCase() to determine if a letter is in an uppercase form. This method also return a boolean value that indicates whether […]
CORE API / CATATAN</>↗Core API17 Jan 2006
In this example you are going to learn another example on using the java.lang.Character class. The Character.isLowerCase() method can be used to determine if a letter is a lowercase letter. This method takes a char as argument and return a boolean value. If it returns true it means the character is in lowercase form. And […]
CORE API / CATATAN</>↗Core API15 Jan 2006
In the previous example you’ve learned how to use the Character.isDigit() method to check if a character representing a digit. In this example you will learn how to check if a character representing a letter. You can use the Character.isLetter(char c) method to check if a character is a valid letter. This method will return […]