Java - How to convert string to charArray ?

String str="Welcome To GeekInterview.com"
How can convert the above string to charArray without using any buit-in function in java?
Anyone to know the answer.please help me? i am new to learn java.

Questions by KALIDOSS T

Showing Answers 1 - 0 of 0 Answers

harshal

  • Aug 27th, 2013
 

It is possible to convert the string to array by using ToCharArray() method.

suppose

Code
  1. String s1="java is great";

  2. char c[]=s1.ToCharArray();

  3.  

Sandhya Rani

  • Sep 3rd, 2013
 

Code
  1.                   String s ="sandhya";

  2.                   char[] charArray= new char[s.length()];

  3.                                  

  4.                   for(int i=0;i<s.length();i++){

  5.                           charArray[i]=s.charAt(i);

  6.                   }

  7.  

  Was this answer useful?  Yes

digvijay kumar

  • Jun 27th, 2015
 

dhakkan you used the Java inbuilt function

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions