java help :o
•
16 Jun 2011, 22:22
•
Journals
yow,
i need some help for some stuff i have to program for university.
i want to replace one character of a string. is it possible?
if so, could you help me how to implement it?
in detail: i got a String[] containing the rows of an adjacence matrix in which i want to change one value (e.g. 1000 in 1100).
thanx in advance
i need some help for some stuff i have to program for university.
i want to replace one character of a string. is it possible?
if so, could you help me how to implement it?
in detail: i got a String[] containing the rows of an adjacence matrix in which i want to change one value (e.g. 1000 in 1100).
thanx in advance
you could always split the string into 3 substrings and replace the middle one?
or if its numeric values, just convert it into an integer? :D
Another aproach (and more efficient in bigger scale) would be making use of regular expressions.
replace the string when current element is the string u want to replace