public static String reverseSubstring(String string, int startIndex, int endIndex) {
		if (string == null || startIndex < 0 || startIndex > endIndex || endIndex > string.length())
			return null;
		
		// build result
		String result = string.substring(0, startIndex); // prefix
		
		int currIndex = endIndex;
		while (currIndex-- > startIndex)
			result += string.charAt(currIndex);
		
		result += string.substring(endIndex, string.length()); // suffix
		
		return result;
	}