Fórum Como converter de uma String para um Array? [RESOLVIDO] #566925
16/07/2011
0
public static void main(String[] args) {
// TODO code application logic here
String teste,str = null;
StringBuffer strBuffer = new StringBuffer();
teste= JOptionPane.showInputDialog("Digite o Comando");
char[] chars = str.toCharArray();
for(int i=0; i < chars.length; i++ ){
strBuffer.append(Integer.toHexString((int) chars[i]));
}
teste = strBuffer.toString();
String Mostra = String.format("O Comando digitado em Hexa é:", teste);
JOptionPane.showMessageDialog(null, teste);
}
}
StringBuffer strBuffer = new StringBuffer();
Lima_will
Curtir tópico
+ 0Posts
16/07/2011
Douglas Eric
char[] testes = teste.toCharArray();
Gostei + 0
16/07/2011
Douglas Eric
String teste,str,tela = null;
teste= JOptionPane.showInputDialog("Digite o Comando");
char[] chars = teste.toCharArray();
StringBuffer strBuffer = new StringBuffer();
for(int i=0; i < chars.length; i++ ){
strBuffer.append(Integer.toHexString((int) chars[i]));
}
tela = strBuffer.toString();
String Mostra = String.format("O Comando digitado em Hexa é:", tela);
JOptionPane.showMessageDialog(null, Mostra);
}
}Gostei + 0
16/07/2011
Douglas Eric
String Mostra = String.format("O Comando digitado em Hexa é:", tela);
String Mostra = String.format("O Comando digitado em Hexa é: %s", tela);
Gostei + 0
16/07/2011
Douglas Eric
Gostei + 0
16/07/2011
Douglas Eric
Gostei + 0
16/07/2011
Douglas Eric
Gostei + 0
16/07/2011
Douglas Eric
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)