Java String Starts Wtih startsWith(String value, String startsWith)

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

Description

Checks if value starts with startsWith.

License

Apache License

Parameter

Parameter Description
value a parameter
startsWith a parameter

Return

true if value starts with startsWith, otherwise false. If any of arguments is null returns false

Declaration

public static boolean startsWith(String value, String startsWith) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/* w w  w  .j  a v a 2 s.  c om*/
     * Checks if <code>value</code> starts with <code>startsWith</code>.
     * @param value
     * @param startsWith
     * @return true if <code>value</code> starts with <code>startsWith</code>, otherwise false. If any of arguments is null returns false
     */
    public static boolean startsWith(String value, String startsWith) {
        if ((value == null) || (startsWith == null)) {
            return false;
        }

        return value.startsWith(startsWith);
    }
}

Related

  1. startsWith(String string, String prefix)
  2. startsWith(String string, StringBuffer prefix, int toffset)
  3. startsWith(String target, String... prefixes)
  4. startsWith(String text, String prefix, int toffset)
  5. startsWith(String toTest, String[] possibilities)
  6. startsWith(String[] array, String obj)
  7. startsWith(String[] beginningSegments, String[] testSegments)
  8. startsWith(String[] searchStrings, String text)
  9. startsWith(String[] target, String[] with)