re: Daily Challenge #1 - String Peeler VIEW POST

FULL DISCUSSION
 

I wanted to take my chances with these challenges, but I decided to start from the beginning, so here's my (super) late entry, done in Java :

public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("Type the word:");
        String word = scan.nextLine();

        if (word.length() > 2) {
            System.out.printf("Result: %s%n", word.substring(1, word.length() - 1));
        } else {
            System.out.println("Invalid word.");
        }

}
code of conduct - report abuse