Here you can find the source of substringMatches(final String source, final String substring, final boolean checkBoundaries)
public static final boolean substringMatches(final String source, final String substring, final boolean checkBoundaries)
//package com.java2s; public class Main { public static final boolean substringMatches(final String source, final String substring, final boolean checkBoundaries) { if (source == null) { return false; }//from www .j a v a 2s. co m if (substring == null || substring.length() == 0) { return true; } int index = source.indexOf(substring); if (index == -1) { return false; } if (!checkBoundaries || index == 0) { return true; } return !Character.isLetterOrDigit(source.charAt(index - 1)); } }