Sunday, 15 September 2013

toCharArray() removing zeros from a string

toCharArray() removing zeros from a string

I have the following (hex) string: 612b048b4e15540d31f5eaa955bea2a0
(StringBuffer sbt), which I convert to char array and iterate through it
like that:
for (char c : sbt.toString().toCharArray()){
//...
}
and do some replacements.
The problem is that I'm losing the 0 characters inside the string - how do
I avoid it?

No comments:

Post a Comment