Marcio_Lima
Testei assim:
String tal = "4";
int soma = 2;
soma += Integer.parseInt(tal);
evefuji
Com String não pode fazer operações com a codificação ASCII, mas com char pode:
'9' - '0' = 9 // resultado em byte se me lembro bem
Para transformar uma String em array de char pode usar o método toCharArray().
Usando
int x = Integer.parseInt("4").intValue(); // não lembro bem se é intValue.
rafael.luc
Testei isso aqui, esta funcionando, mas esta correto?
public static void main(String[] args) {
String num = "1101001";
int id = Integer.parseInt(num.substring(0, 1));
int func = Integer.parseInt(num.substring(1, 2));
int tag = Integer.parseInt(num.substring(2, 4));
int valor = Integer.parseInt(num.substring(4, 7));
id = id + 3;
func = func + 3;
System.out.println(id+""+func+""+tag+""+valor);
}