Here you can find the source of startsWithCharacter(String str, String matchChars)
Parameter | Description |
---|---|
str | a parameter |
matchChars | a parameter |
public static boolean startsWithCharacter(String str, String matchChars)
//package com.java2s; //License from project: Creative Commons License public class Main { /**//from w ww . ja v a2 s .co m * Check for defined Characters at start of Word or Sequence of words * * @param str * @param matchChars * @return */ public static boolean startsWithCharacter(String str, String matchChars) { for (int i = 0; i < str.length(); i++) { final char ch = str.charAt(i); final int index = matchChars.indexOf(ch); if (index != -1) { return true; } else { return false; } } return false; } }