Here you can find the source of compare(String s1, String s2)
Parameter | Description |
---|---|
s1 | string1 |
s2 | string2 |
public static int compare(String s1, String s2)
//package com.java2s; //License from project: Apache License public class Main { /**// w w w.jav a 2 s . c om * Comare two string * * @param s1 * string1 * @param s2 * string2 * @return result */ public static int compare(String s1, String s2) { return s1 == null ? (s2 == null ? 0 : -1) : s1.compareTo(s2); } }