Java - Write code to cut a string by length

Requirements

Write code to cut a string by length

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String s = "book2s.com";
        int n = 4;
        System.out.println(drop(s, n));
    }//from  ww  w .j  a  v  a 2s  . c om

    public static String drop(String s, int n) {
        if (n <= 0)
            return s;
        else if (n < s.length())
            return s.substring(n);
        else
            return "";
    }
}