src/main/java/com/findupon/commons/building/AttributeOperations.java
/**
	 * alone == not touching a letter or digit, inclusive to string start or end
	 */
alone == not touching a letter or digit, inclusive to string start or end
alone == not touching a letter or digit inclusive to string start or end
public static boolean containsLoneAttribute(String text, String attr) {
		if(StringUtils.isEmpty(text) || StringUtils.isEmpty(attr) || !StringUtils.containsIgnoreCase(text, attr)) {
			return false;
		}
		text = text.toUpperCase(Locale.ENGLISH);
		attr = attr.toUpperCase(Locale.ENGLISH);
		int attrStart = text.indexOf(attr);
		int attrFinish = text.indexOf(attr) + attr.length();
		char before = attrStart == 0 ? '~' : text.substring(attrStart - 1, attrStart).charAt(0);
		char after = attrFinish == text.length() ? '~' : text.substring(attrFinish, attrFinish + 1).charAt(0);
		return !Character.isLetter(before) && !Character.isLetter(after) && !Character.isDigit(before) && !Character.isDigit(after);
	}
public static boolean containsLoneAttribute ( String text , String attr ) { if ( StringUtils . isEmpty ( text ) || StringUtils . isEmpty ( attr ) || ! StringUtils . containsIgnoreCase ( text , attr ) ) { return false ; } text = text . toUpperCase ( Locale . ENGLISH ) ; attr = attr . toUpperCase ( Locale . ENGLISH ) ; int attrStart = text . indexOf ( attr ) ; int attrFinish = text . indexOf ( attr ) + attr . length ( ) ; char before = attrStart == 0 ? '~' : text . substring ( attrStart - 1 , attrStart ) . charAt ( 0 ) ; char after = attrFinish == text . length ( ) ? '~' : text . substring ( attrFinish , attrFinish + 1 ) . charAt ( 0 ) ; return ! Character . isLetter ( before ) && ! Character . isLetter ( after ) && ! Character . isDigit ( before ) && ! Character . isDigit ( after ) ; }
alone == not touching a letter or digit, inclusive to string start or end
alone == not touching a letter or digit inclusive to string start or end