Java String Sub String substringMatch(CharSequence str, int index, CharSequence substring)

Here you can find the source of substringMatch(CharSequence str, int index, CharSequence substring)

Description

substring Match

License

Apache License

Declaration

public static boolean substringMatch(CharSequence str, int index, CharSequence substring) 

Method Source Code

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

public class Main {
    public static boolean substringMatch(CharSequence str, int index, CharSequence substring) {
        for (int j = 0; j < substring.length(); j++) {
            int i = index + j;
            if (i >= str.length() || str.charAt(i) != substring.charAt(j)) {
                return false;
            }/*from  w w  w . j av a2 s  .c o  m*/
        }
        return true;
    }
}

Related

  1. subStringIgnoreCase(String str, String separator, Integer stratNum, Integer endNum)
  2. substringInBetween(String name, String prefix, String delimiter)
  3. substringL(String s, int i, int len)
  4. substringLinesWithTokenOfEOL( String originalString, String stringToBeInserted)
  5. substringMatch(CharSequence str, int index, CharSequence substring)
  6. substringMatches(final String source, final String substring, final boolean checkBoundaries)
  7. substringMore(String s, int maxlen)
  8. subStringNobit(String str, int toCount, String more)
  9. subStringNotEncode(String subject, int size)