public class MetodosCadena
{
public static void main(String[] args) {
StringBuilder texto=new StringBuilder(JOptionPane.showInputDialog("ingrese una palabra: "));
texto.append("Trujillo");
JOptionPane.showMessageDialog(null, texto);
JOptionPane.showMessageDialog(null, texto.toString().toUpperCase());
texto.insert(7, "10");
JOptionPane.showMessageDialog(null, texto);
texto.reverse();
JOptionPane.showMessageDialog(null, texto);
StringBuilder texto1=new
StringBuilder(JOptionPane.showInputDialog("ingrese
su nombre: "));
texto.reverse();
JOptionPane.showMessageDialog(null, texto);
StringBuilder texto3=new
StringBuilder(JOptionPane.showInputDialog("ingrese
palabra: "));
StringBuilder texto2=new
StringBuilder(JOptionPane.showInputDialog("ingrese
segunda palabra: "));
texto.equals(texto3 == texto2);
JOptionPane.showMessageDialog(null, texto2);
}
}
No hay comentarios :
Publicar un comentario