@Description("Returns a specified number of characters from a string.")
public static String mid(String value, int beginIndex, int length) {
// Arguments are 1-based. Spec says that the function gives an error if
// Start <= 0 or Length < 0.
if (beginIndex <= 0) {
throw new InvalidArgumentException(
"Invalid parameter. "
+ "Start parameter of Mid function must be positive");
}
if (length < 0) {
throw new InvalidArgumentException(
"Invalid parameter. "
+ "Length parameter of Mid function must be non-negative");
}
if (beginIndex > value.length()) {