@@ -0,0 +1,1589 @@
+package io.proleap.vb6.asg.util;%0A%0Apublic class StringUtils %7B%0A%0A%09public static String capitalize(final String str) %7B%0A%09%09if (str == null %7C%7C str.isEmpty()) %7B%0A%09%09%09return str;%0A%09%09%7D%0A%0A%09%09return str.substring(0, 1).toUpperCase() + str.substring(1);%0A%09%7D%0A%0A%09public static int countMatches(final String str, final String target) %7B%0A%09%09return (str.length() - str.replace(target, %22%22).length()) / target.length();%0A%09%7D%0A%0A%09public static String leftPad(final String str, final int size) %7B%0A%09%09return leftPad(str, size, %22 %22);%0A%09%7D%0A%0A%09public static String leftPad(final String str, final int size, final String padChar) %7B%0A%09%09final int pads = Math.max(0, size - str.length());%0A%09%09return padChar.repeat(pads).concat(str);%0A%09%7D%0A%0A%09public static String lowercaseFirstLetter(final String data) %7B%0A%09%09final char firstLetter = Character.toLowerCase(data.substring(0, 1).charAt(0));%0A%09%09final String restLetters = data.substring(1);%0A%09%09return firstLetter + restLetters;%0A%09%7D%0A%0A%09public static String rightPad(final String str, final int size) %7B%0A%09%09return rightPad(str, size, %22 %22);%0A%09%7D%0A%0A%09public static String rightPad(final String str, final int size, final String padChar) %7B%0A%09%09final int pads = Math.max(0, size - str.length());%0A%09%09return str.concat(padChar.repeat(pads));%0A%09%7D%0A%0A%09public static String substringAfter(final String str, final String separator) %7B%0A%09%09final int pos = str.indexOf(separator);%0A%09%09return pos == -1 ? %22%22 : str.substring(pos + separator.length());%0A%09%7D%0A%0A%09public static String substringBefore(final String str, final String separator) %7B%0A%09%09final int pos = str.indexOf(separator);%0A%09%09return pos == -1 ? str : str.substring(0, pos);%0A%09%7D%0A%7D%0A

string utils