class Strings {

    public static String getBegin(String str, int length) {
        if (str == null) {
            return null;
        }
        else if (str.length() < length) {
            return str;
        }
        else {
            return str.substring(0, length);
        }
    }

    private  Strings();

}