Ad
  • Custom User Avatar

    Compiler won't do StringBuilder magic on this one most likely. In general that loop gets turned into:

    String result = "";
    for (int i = 0; i < str.length()-4; i++) {
    result = new StringBuilder().append(result).append('#').toString();
    }