package io.proleap.cobol.asg.util;

public class StringUtils {

	public static String capitalize(final String str) {
		if (str == null || str.isEmpty()) {
			return str;
		}

		return str.substring(0, 1).toUpperCase() + str.substring(1);
	}

	public static String lowercaseFirstLetter(final String data) {
		final char firstLetter = Character.toLowerCase(data.substring(0, 1).charAt(0));
		final String restLetters = data.substring(1);
		return firstLetter + restLetters;
	}
}

@@ -254,221 +254,1335 @@
 tic 
-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
+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

string utils