final String sourceString = firstItem.stringValue();
final int maxSourceLen = sourceString.length();
final Item secItem = argv.getItem(1);
final XNumber secNum = (XNumber) secItem;
// first character of a string is located at position 1, not position 0.
final int startingLoc = Math.max(0, (int) Math.round(secNum.asDouble() - 1));
final int endingLoc;
final int arglen = argv.size();
if(arglen == 3) {
final Item thirdItem = argv.getItem(2);
final XNumber thirdNum = (XNumber) thirdItem;