viernes, 8 de enero de 2016

CLASE STRINGBUILDER


public class MetodosCadena {
    public static void main(String[] args) {
        StringBuilder texto=new StringBuilder(JOptionPane.showInputDialog("ingrese una palabra:  "));
        texto.append("Tacuri");
        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);
    }   

}

0 comentarios :

Publicar un comentario

Recent Posts