convert cstring to char array code example
Example 1: converting char array to string
// Convert char array to String in Java
class Util
{
public static void main(String[] args)
{
char[] chars = {'T', 'e', 'c', 'h', 'i', 'e', ' ',
'D', 'e', 'l', 'i', 'g', 'h', 't'};
String string = new String(chars);
System.out.println(string);
}
}
Example 2: how to covert array into a char
String s="Welcome to Java Programming";
char arr[]=s.toCharArray();
for(int i=0;i