/** * Like a String.lastIndexOf but without MIN_SUPPLEMENTARY_CODE_POINT handling * * @param input to check the indexOf on * @param ch character to find the index of * @return index of the character, or -1 if not found */ public static int lastIndexOf(String input, char ch) { return lastIndexOf(input, ch, 0); }
/** * Like a String.lastIndexOf but without MIN_SUPPLEMENTARY_CODE_POINT handling * * @param input to check the indexOf on * @param ch character to find the index of * @return index of the character, or -1 if not found */ public static int lastIndexOf(String input, char ch) { return lastIndexOf(input, ch, 0); }
public static String extractAttributeNameNameWithoutArguments(String attributeNameWithArguments) { int start = StringUtil.lastIndexOf(attributeNameWithArguments, '['); int end = StringUtil.lastIndexOf(attributeNameWithArguments, ']'); if (start > 0 && end > 0 && end > start) { return attributeNameWithArguments.substring(0, start); } if (start < 0 && end < 0) { return attributeNameWithArguments; } throw new IllegalArgumentException("Wrong argument input passed " + attributeNameWithArguments); }
public static String extractArgumentsFromAttributeName(String attributeNameWithArguments) { int start = StringUtil.lastIndexOf(attributeNameWithArguments, '['); int end = StringUtil.lastIndexOf(attributeNameWithArguments, ']'); if (start > 0 && end > 0 && end > start) { return attributeNameWithArguments.substring(start + 1, end); } if (start < 0 && end < 0) { return null; } throw new IllegalArgumentException("Wrong argument input passed " + attributeNameWithArguments); }
public static String extractArgumentsFromAttributeName(String attributeNameWithArguments) { int start = StringUtil.lastIndexOf(attributeNameWithArguments, '['); int end = StringUtil.lastIndexOf(attributeNameWithArguments, ']'); if (start > 0 && end > 0 && end > start) { return attributeNameWithArguments.substring(start + 1, end); } if (start < 0 && end < 0) { return null; } throw new IllegalArgumentException("Wrong argument input passed " + attributeNameWithArguments); }
public static String extractAttributeNameNameWithoutArguments(String attributeNameWithArguments) { int start = StringUtil.lastIndexOf(attributeNameWithArguments, '['); int end = StringUtil.lastIndexOf(attributeNameWithArguments, ']'); if (start > 0 && end > 0 && end > start) { return attributeNameWithArguments.substring(0, start); } if (start < 0 && end < 0) { return attributeNameWithArguments; } throw new IllegalArgumentException("Wrong argument input passed " + attributeNameWithArguments); }