Answers for "java string to char array"

27

java string to char array

String str = "example";
char[] ch = str.toCharArray();
Posted by: Guest on March-05-2020
13

char array to string java

char[] a = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'};
String str = new String(a);
Posted by: Guest on June-15-2020
2

Convert char array to string in java

// java convert array of char to string
public class CharArrayToString
{
   public static void main(String[] args)
   {
      char[] charArray = new char[]{'F','l','o','w','e','r','B','r','a','c','k','e','t','s'};
      String str = new String(charArray);
      System.out.println(str);
   }
}
Posted by: Guest on December-31-2020
0

java char array to string

final char[] charArray = { 'g','e','e','k','s','f','o','r','g','e','e','k','s' };
    String string = new String(charArray);

	System.out.println(string);

	// -> "geeksforgeeks"
Posted by: Guest on May-28-2021
0

change string to char array

String myString = "Hello, world!";
char[] myCharArray = myString.toCharArray();
Posted by: Guest on May-13-2021
0

String to Char array

String s="abcd";
char[] a=s.toCharArray();

for(char c:a)
{ 	System.out.println(c); } 
Posted by: Guest on August-23-2021

Code answers related to "java string to char array"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language