Java Array Start With startWith(char[] value, char c)

Here you can find the source of startWith(char[] value, char c)

Description

start With

License

Open Source License

Declaration

public static int startWith(char[] value, char c) 

Method Source Code

//package com.java2s;
/***************************************************************************
 * Copyright 2001-2006 VietSpider         All rights reserved.  *
 * Please look at license.txt in info directory for more license detail.   *
 **************************************************************************/

public class Main {
    public static int startWith(char[] value, char c) {
        for (int i = 0; i < value.length; i++) {
            if (Character.isSpaceChar(value[i])
                    || Character.isWhitespace(value[i]))
                continue;
            else if (c == value[i])
                return i;
            else//from w  w w .  j a  v a 2  s  . com
                return -1;
        }
        return -1;
    }
}

Related

  1. arrayStartsWith(byte[] array, byte[] target)
  2. arrayStartsWith(final byte[] array, final byte[] str)
  3. arrayStartsWith(V[] pattern, V[] data)
  4. startWith(byte[] data, int start, byte[] find)
  5. startWith(byte[] startWith, byte[] bytes)
  6. startWith(final byte[] aBuffer, final byte[] aPrefix)
  7. startWith(String t, String[] prefix)