Here you can find the source of areEquals(final String origin, final String checkWith)
public static boolean areEquals(final String origin, final String checkWith)
//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)); } }