Java String Equal areEquals(final String origin, final String checkWith)

Here you can find the source of areEquals(final String origin, final String checkWith)

Description

are Equals

License

Open Source License

Declaration

public static boolean areEquals(final String origin, final String checkWith) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static boolean areEquals(final String origin, final String checkWith) {
        return !isNullOrEmpty(origin) && origin.equals(checkWith);
    }//from   w ww. j  a  v  a 2 s  .  c  om

    public static boolean isNullOrEmpty(String origin) {
        return (origin == null || origin.trim().isEmpty());
    }

    public static void trim(final String s) {
        int i = 0, j = 0, k = 0;

        for (i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if (ch != ' ')
                break;
        }
        for (j = s.length() - 1; j >= 0; j--) {
            char ch = s.charAt(j);
            if (ch != ' ')
                break;
        }
        for (k = i; k < j + 1; k++)
            System.out.print(s.charAt(k));
    }
}

Related

  1. areEqual(String thisString, String thatString)
  2. areEqualConstantTime(String a, String b)
  3. areEqualIgnoreCase(String s1, String s2)
  4. areEqualIgnoreNull(String value1, String value2, boolean caseSensitive)
  5. areEqualLexemes(String l1, String l2)
  6. areEquals(final String s1, final String s2)
  7. areEqualsIgnoreCaseAndTrim(final String s1, final String s2)
  8. areEqualXMLValues(String s1, String s2)
  9. areStringEquals(String s1, String s2)