Sunday, 22 February 2015

How to convert String to char and vice versa?

his is a tricky question because String is a sequence of characters, so we can’t convert it to a single character. We can use use charAt method to get the character at given index or we can usetoCharArray() method to convert String to character array.
Check this post for sample program on converting String to character array to String.

No comments:

Post a Comment