Fórum Array de char para String #568542
09/04/2009
0
char KeyText[] = {'a','b','c'};
str = new String(KeyText);KeyText[0] = 'b';
Marciano Pazinato
Curtir tópico
+ 0Posts
09/04/2009
Dadario
List keyText = new ArrayList();
keyText.add(new Character('a'));char[] values = new char[keyText.size()];
int i = 0;
for(Iterator iter = keyText.iterator(); iter.hasNext(); i++) {
values[i] = ((Character)iter.next()).charValue();
}
String suaString = new String(values);Gostei + 0
09/04/2009
Marciano Pazinato
Gostei + 0
09/04/2009
[pt]devilishly
int LENGTH = 10; char[] keyText = new char[LENGTH ];
keyText[0] = 'b';
public void refazerArray(){
LENGTH = LENGTH*2;
char[] temp = new char[LENGTH];
for(int i=0; i<keyText.length; i++)
temp[i] = keyText[i];
keyText = new char[temp.length];
for(int i=0; i<keyText.length; i++)
keyText[i] = temp[i];
}Gostei + 0
09/04/2009
Marciano Pazinato
Gostei + 0
09/04/2009
Dadario
Gostei + 0
09/04/2009
Ricardo
Gostei + 0