Java Learner logo
← Back to all exercises

Strings

Tweaking text with StringBuilder

Type the exact line printed, including spaces and capitalization.

Strings

Tweaking text with StringBuilder

BeginnerAwaiting attempt

Type the exact line printed, including spaces and capitalization.

public class Main {
    public static void main(String[] args) {
        StringBuilder slogan = new StringBuilder("JAVA");
        slogan.replace(1, 3, "oke");
        slogan.append(" 17");
        slogan.insert(0, "Learn ");
        System.out.println(slogan.toString().trim());
    }
}