Java String Starts Wtih startsWith(String s1, String s2)

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

Description

starts With

License

Open Source License

Declaration

public static boolean startsWith(String s1, String s2) 

Method Source Code

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

public class Main {
    public static boolean startsWith(String s1, String s2) {
        if (s1 == null) {
            if (s2 == null) {
                return true;
            } else {
                // return s2.startsWith(s1);
                return false;
            }/*from   www  .  j av a 2 s .  c  o m*/
        } else {
            if (s2 == null) {
                return false;
            } else {
                return s1.startsWith(s2);
            }

        }
    }
}

Related

  1. startswith(String s, String prefix)
  2. startsWith(String s, String prefix)
  3. startsWith(String s, String prefix)
  4. startsWith(String s, String start)
  5. startsWith(String s, String start)
  6. startsWith(String self, String pattern)
  7. startsWith(String source, String target, boolean caseSensitive)
  8. startsWith(String str, char c)
  9. startsWith(String str, char prefix)