How to replace special charactes

what I want to do is to replace it with 9 if 3 is written in the 3rd character in a data. But I only want to do this for the 3rd character. How can I do it? This code I wrote replaces all 3’s in the string with 9.

Regards

    String adana = "123456789133";
    if (adana.length() > 2 && adana.charAt(2) == '3'){
            final String newText = adana.replace("3", "9");
            Log.d("TAG", "onCreate: " + newText);
    }

Answer

Try concatenating substrings:

 String adana = "123456789133";
 if (adana.length() > 2 && adana.charAt(2) == '3') {
     final String newText = adana.substring(0,2) + "9" + adana.substring(3);
     Log.d("TAG", "onCreate: " + newText);
 }