DEV Community

loading...

Discussion on: Daily Challenge #1 - String Peeler

Collapse
rodrigoords profile image
Rodrigo Sene

JAVA

public class Solution {

    public static String getStringCore(String input){
        if(input.length() > 2){
            return input.substring(1, input.length() -1);
        }
        return "invalid input";
    }

    public static void main(String[] arg){
        System.out.println(Solution.getStringCore("let's do it agin"));
    }
}