How to convert string to array & array to string? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How to convert string to array & array to string?

Related to usually asked questions in written test before interview.

21st Dec 2019, 11:13 AM
Shashank Reddy Voorelli
Shashank Reddy Voorelli - avatar
3 Answers
+ 3
You can easily convert string into char array using: <string>.toCharArray() And convert char array to string: String.join(<char array>)
21st Dec 2019, 11:23 AM
Seb TheS
Seb TheS - avatar
+ 1
In C, a string is a char array, no need for conversion AFAIK.
21st Dec 2019, 11:24 AM
Ipang
0
In Java you can use the (toCharArray()) method from the String class
21st Dec 2019, 11:21 AM
Abdol Hashimi
Abdol Hashimi - avatar