jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java
public static String left(final String s, final int len) {
        if (s == null) {
            return null;
        }
        if (len < 0) {
            return "";
        }
        if (s.length() <= len) {
            return s;
        }
        return s.substring(0, len);
    }
public static String left(final String s, final int len) {
        if (s == null) {
            return null;
        }
        if (len < 0) {
            return "";
        }
        if (s.length() <= len) {
            return s;
        }
        return s.substring(0, len);
    }
<p>
Gets the leftmost {@code len} characters of a String.
</p>

<p>
If {@code len} characters are not available, or the String is
{@code null}, the String will be returned without an exception. An empty
String is returned if len is negative.
</p>

<pre>
StringUtils.left(null, *)    = null
StringUtils.left(*, -ve)     = ""
StringUtils.left("", *)      = ""
StringUtils.left("abc", 0)   = ""
StringUtils.left("abc", 2)   = "ab"
StringUtils.left("abc", 4)   = "abc"
</pre>