is string Started By a string in a List - Android java.lang

Android examples for java.lang:String Starts or Ends

Description

is string Started By a string in a List

Demo Code

import java.util.ArrayList;

public class Main {

  public static boolean isStartedByList(String str, ArrayList<String> whiteList) {
    for (String white : whiteList) {
      if (str.startsWith(white))
        return true;
    }/*w w  w. j av  a  2  s  .  c  om*/
    return false;
  }

}

Related Tutorials