[java] How do I get the first n characters of a string without checking the size or going out of bounds?

Apache Commons Lang has a StringUtils.left method for this.

String upToNCharacters = StringUtils.left(s, n);