About 993,000 results
Open links in new tab
  1. Converting String to "Character" array in Java - Stack Overflow

    Apr 4, 2012 · String#toCharArray returns an array of char, what you have is an array of Character. In most cases it doesn't matter if you use char or Character as there is autoboxing.

  2. How to convert a String array to char array in Java

    Oct 25, 2013 · How to convert a String array to char array in Java Asked 12 years, 1 month ago Modified 1 year, 2 months ago Viewed 68k times

  3. Convert an integer to an array of characters : java

    What is the best way to convert an integer into a character array? Input: 1234 Output: {1,2,3,4} Keeping in mind the vastness of Java language what will be the best and most efficient way of …

  4. String to char array Java - Stack Overflow

    Apr 7, 2012 · A string to char array is as simple as String str = "someString"; char[] charArray = str.toCharArray(); Can you explain a little more on what you are trying to do? * Update * if I am …

  5. Converting Char Array to List in Java - Stack Overflow

    Can anyone help me and tell how to convert a char array to a list and vice versa. I am trying to write a program in which users enters a string (e.g "Mike is good") and in the output, each …

  6. java - Should I use charAt or toCharArray? - Stack Overflow

    Mar 17, 2014 · Which of the following options is considered a good practice to loop through the String? Should we use charAt or convert to a char array ? I am looking for answers in all terms …

  7. java - Is it a good practice to put String.toCharArray () into for loop ...

    Aug 10, 2016 · In your second example, s.toCharArray().length is invoked on each execution of the loop. That's unfortunate, because it copies the string into a new array each time, making …

  8. How do I apply the for-each loop to every character in a String?

    Mar 16, 2010 · From the documentation: [toCharArray() returns] a newly allocated character array whose length is the length of this string and whose contents are initialized to contain the …

  9. Include spaces in String.toCharArray Java - Stack Overflow

    May 15, 2017 · Include spaces in String.toCharArray Java Asked 11 years, 11 months ago Modified 3 years, 6 months ago Viewed 7k times

  10. java - How to convert ArrayList of Strings to char array - Stack …

    Feb 3, 2016 · Your toString method on list is what is adding the comma and space, it's a String representation of your list. As list is a collection of String s you don't need to call toString on it, …