Java String Ends With endsWith(String s1, String s2)

Here you can find the source of endsWith(String s1, String s2)

Description

ends With

License

Open Source License

Declaration

public static boolean endsWith(String s1, String s2) 

Method Source Code

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

public class Main {
    public static boolean endsWith(String s1, String s2) {
        if (s1 == null) {
            if (s2 == null) {
                return true;
            } else {
                // return s2.endsWith(s1);
                return false;
            }/*from   w w w .  j a  v a  2  s.  co m*/
        } else {
            if (s2 == null) {
                return false;
            } else {
                return s1.endsWith(s2);
            }

        }
    }
}

Related

  1. endsWith(String s, String end)
  2. endsWith(String s, String end)
  3. endsWith(String s, String end)
  4. endsWith(String s, String ending)
  5. endsWith(String s, String suffix)
  6. endsWith(String source, String target, boolean caseSensitive)
  7. endsWith(String str, char c)
  8. endsWith(String str, char suffix)
  9. endsWith(String str, char suffix)