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

Tags:

Misc Example


Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools