Found 1 Articles for Jsoup

Compare the two Strings lexicographically in Java

Samual Sam
Updated on 19-Jun-2020 14:37:04
The compareTo() method of the String class. This method compares two Strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argument string. This method returnsa negative integer if current String object lexicographically precedes the argument string.a positive integer if current String object lexicographically follows the argument.true when the strings are equal.Exampleimport java.lang.*; public class StringDemo {    public static void main(String[] args) {       String str1 = "tutorials", str2 = "point";     ... Read More
1
Advertisements