// 6. Um método que recebe um texto, uma posição e uma letra e substitui o caractere que esta na
// posição pela letra recebida no parâmetro.
package exerciciosstring;
import java.util.Scanner;
public class EstudarA6 {
/*public static String analisar(String frase){
int posição;
String letra;
    for(int i=0; i<frase.length(); i++)
    {
    String lugar = frase.charAt(i)+ "";
    
    
    
    
    
      
      
    }
    String lugar;
    
    System.out.println(lugar); 
    
    return lugar;
}  */
public static void main(String[] args) {
    Scanner leitura = new Scanner(System.in);
    int L;
    String texto;
    String caracter;
    
          
    System.out.println("Digite o texto:");
    texto = leitura.nextLine();
    
    System.out.println("Digite a posição:");
    L = leitura.nextInt();
    
    System.out.println("Digite a letra:");
    caracter = leitura.nextLine();
    
    //if(L < texto.length())
    //for(int i=0; i<texto.length(); i++)
    if(L<texto.length())
    {
        String letra = texto.charAt(L)+ "";
       //texto = texto.replace(L ,caracter);
        
     
    }
// String retorno = analisar(texto);
//System.out.println(“Assim ficará com a troca:” + retorno);
    //String str.charAt(i);
    //System.out.println(ler);                
    //String s;
    //System.out.println(s); // antes
    //s = s.replace('1', 'c'); // troca o 1 pelo c : estou trocando a posicao 2 pois a contagem comeca do 0
                           // ou seja, 0 = a , 1 = b, 2 = 1 , 3 = d, 4 = e, 5 = f
//System.out.println(s); //depois
}
}
//String texto;
//char i;
//char letra;
   // System.out.println("Digite o texto:");
    //texto = leitura.nextLine();
    
   // System.out.println("Digite a posição que você deseja:");
    //i = (char) leitura.nextInt();
    
    //System.out.println("Digite a letra:");
    //letra = (char) leitura.nextInt();
JÁ TENTEI DE TUDO MAS NÃO CONSIGO FAZER DAR, O QUE PODE SER, OU FALTAR??