@@ -0,0 +1,600 @@
+package com.valerysamovich.java.basics.exercises;%0A%0Apublic class StringHelper %7B%0A    %0A    public String truncateAInFirstTwoPositions(String str) %7B%0A        %0A        // If string equal 0%0A        if (str.length() == 0) %7B%0A            return str;%0A        %7D%0A        %0A        // If string more then 2 char%0A        if (str.length() %3C 2) %7B%0A            return str.replace(%22A%22, %22%22);%0A        %7D%0A        %0A        String first2Char = str.substring(0, 2);%0A        String afterFirst2Char = str.substring(2);%0A        %0A        // Return the result%0A        return first2Char.replaceAll(%22A%22, %22%22) + afterFirst2Char;%0A    %7D%0A%7D%0A

Add Trancate Example