// remove leading zeroes (or error out if not zeroes)
int remove = (v.length() - length);
// check if any of these are non-zero
for (int i = 0; i < remove; i++) {
if (v.charAt(i) != '0') {
throw new ConversionOverflowException("Overflow of value detected; unable to trim value [" + v + "] to length " + length);
}
}
return v.substring(remove);
}
}