Java String Starts Wtih startsWith(String inStart, String inValue)

Here you can find the source of startsWith(String inStart, String inValue)

Description

NPE safe String startsWith

License

Open Source License

Parameter

Parameter Description
inStart a parameter
inValue a parameter

Declaration

public static boolean startsWith(String inStart, String inValue) 

Method Source Code

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

public class Main {
    /**//w w  w.  ja  v  a  2 s  .  c o m
     * NPE safe {@link String} startsWith
     * 
     * @param inStart
     * @param inValue
     * @return
     */
    public static boolean startsWith(String inStart, String inValue) {

        if (inStart == null && inValue == null) {

            return true;

        } else if (inStart == null || inValue == null) {

            return false;
        }

        return inValue.startsWith(inStart);
    }
}

Related

  1. startsWith(final String str, final String... prefixes)
  2. startsWith(String baseString, String compareString)
  3. startsWith(String check, String doesStartWith)
  4. startsWith(String cid1, String cid2)
  5. startsWith(String comparee, char comparant)
  6. startsWith(String n, char tag)
  7. startsWith(String partial, String possible)
  8. startsWith(String path, String prefix)
  9. startsWith(String prefix, String string, boolean caseInsensitive)