Kotlinlearncs.online LogoJava
Return to List

Solve: replaceAll Goblin Translator

Created By: Justin Maier
/ Version: 2024.9.0

You've found a mistranslated Goblin manuscript that mixed up two of their most common words: "blarg" (meaning "cheese") and "snarf" (meaning "cake"). The problem is whoever translated it accidentally swapped the meanings!

You are given a String variable named mistranslation containing this mistranslated text. Your task is to swap every occurrence of "blarg" with "snarf" and vice-versa to fix this mistranslation and print it out.

Search the String documentation linked here for the method replaceAll which you will use in this problem.

Related Lessons

Stuck? You may find these lessons helpful: