Core java
15 MayGhid practic pentru casino online 777 – Cum să începi și să câștigi
777 casino ro se remarcă pe o piață competitivă, iar acest ghid pas cu pas explică exact cum să profiÈ›i la maximum de el. Fie că eÈ™ti la primul contact cu un cazino online 777 sau ai deja experiență, următoarele informaÈ›ii te vor ajuta să navighezi eficient, să revendici bonusuri È™i să gestionezi eventualele probleme. […]
14 MayJava String equalsIgnoreCase example
String’s equalsIgnoreCase method is similar to equals method but it ignores case. So if Strings have different cases, then also it will considered as equals. For example: [crayon-6a29a9d7d2bf4712212916/] str1.equalsIgnoreCase(str2) will return true. Method Signature: [crayon-6a29a9d7d2c00271468182/] String equalsIgnoreCase Example: [crayon-6a29a9d7d2c02909401850/] When you run above program, you will get below output: [crayon-6a29a9d7d2c03501487867/]
14 MayJava String equals example
String’s equals method compares String with specified object. It checks if both have same character sequence. It is generally used to compare two Strings. Method Signature: [crayon-6a29a9d7d36f3300786448/] String equals Example: [crayon-6a29a9d7d36fa996407831/] When you run above program, you will get below output: [crayon-6a29a9d7d36fc919950460/]
14 MayJava String contentEquals example
String’s contentEquals method is used to compare String with StringBuffer. It returns boolean datatype. Method syntax: [crayon-6a29a9d7d3cc7308961605/] String contentEquals Example: [crayon-6a29a9d7d3ccc470063950/] When you run above program, you will get below output: [crayon-6a29a9d7d3ccd705563013/] Please note that contentEquals method is case sensitive as you can see in above example
13 MayJava String endsWith example
String’s endWith method checks if String ends with specific suffix. It returns boolean datatype. Method syntax: [crayon-6a29a9d7d55de375085062/] String endsWith Example: [crayon-6a29a9d7d55e6711313551/] When you run above program, you will get below output: [crayon-6a29a9d7d55e7452005781/] Please note that endsWith method is case sensitive as you can see in above example
12 MayJava String startsWith example
String’s startsWith method checks if String starts with specific prefix. It returns boolean datatype. Method Signature: [crayon-6a29a9d7d626e727121467/] String startsWith Example: [crayon-6a29a9d7d6279297817955/] When you run above program, you will get below output: [crayon-6a29a9d7d627b800419499/] Please note that startsWith method is case sensitive as you can see in above example
12 MayJava String charAt example
String’s charAt method returns char value present at specified index. String is nothing but Sequence of char values and it starts with index 0. Method Signature: [crayon-6a29a9d7d7aa4054700664/] String charAt Example: [crayon-6a29a9d7d7aac978258617/] When you run above program, you will get below output: [crayon-6a29a9d7d7aad690168577/]
11 MayJava String trim example
String’s trim method is used to remove leading and trailing space. Sometimes, you get extra leading or trailing space and your program does not work as expected. It returns String object after removing leading and trailing spaces. String’s trim method does not remove middle spaces. String trim example: [crayon-6a29a9d7d8040820429632/] When you run above program, you […]
10 MayHow to check if two Strings are Anagrams in Java
In this post, we will see how to check if two Strings are Anagrams in java. Anagrams mean if two Strings have the same characters but in a different order. For example: Angel and Angle are anagrams There are many ways to check if Strings are anagrams in java. Some of them are: Using String […]