Ad
Strings
Data Types

In order to understand the everyday hasstle of people that suffer from dislexia my school made us do this activity:

  • replace all the (A's O's E's I's) of a certain phrase with (4's 0's 3's 1's) respectively

and we did it, but it took soooo long, would you write a bit of code that does the work for me?

e.g.:

dislexifier ->

  • input : "Hey Arianna, how u doing?"
  • output : "H3y 4ri4nn4, h0w u d01ng?"

ps.: try to avoid just using .replace(), it will make it more fun.

class Dislexifier
{
  public static String theDislexifier(String str)
  {
    
    // TODO: Do your magic here 
    
    return str.replace("a","4").replace("A","4").replace("o","0").replace("O","0").replace("e","3").replace("E","3").replace("i","1").replace("I","1");
  }
}