0
i want the sentence without numbers. But what's wrong here?
2 Respostas
+ 1
a=s.replaceAll("1","one");
a=s.replaceAll("2","two")
Here, you are storing new string in a, which is 1 replaced, next replacing 2 but not in new string a but in old string s..
So only last 9 is replaced result will be available by overwriting old once...
So do like this...
a=s.replaceAll("1","one");
a=a.replaceAll("2","two");.....
Without needing a variable, use only s like..
s=s.replaceAll("1","one");
s=s.replaceAll("2","two");
...
s=s.replaceAll("9","nine);