package com.valerysamovich.java.basics.exercises;

public class StringHelper {
    
    public String truncateAInFirstTwoPositions(String str) {
        
        // If string equal 0
        if (str.length() == 0) {
            return str;
        }
        
        // If string more then 2 char
        if (str.length() < 2) {
            return str.replace("A", "");
        }
        
        String first2Char = str.substring(0, 2);
        String afterFirst2Char = str.substring(2);
        
        // Return the result
        return first2Char.replaceAll("A", "") + afterFirst2Char;
    }
}

@@ -73,24 +73,148 @@
 lper %7B%0A    %0A
+    /**%0A     * Remove all characters 'A' in first 2 positions of the given string.%0A     * @param str%0A     * @return%0A     */%0A
     public S

Add JavaDoc