About 574,000 results
Open links in new tab
  1. Java How To Convert a String to an Array - W3Schools

    There are many ways to convert a string to an array. The simplest way is to use the toCharArray() method: Convert a string to a char array: You can also loop through the array to print all array …

  2. string to string array conversion in java - Stack Overflow

    Jun 5, 2020 · static String[] convert(String... array) { return array; } String[] array = convert("name","age","hobby"); [Edit] If you want single-letter Strings, you can use: String[] s = …

  3. Convert a String to Character Array in Java - GeeksforGeeks

    Jan 4, 2025 · In this article, we will learn various ways to convert a string into a character array in Java with examples. Example: The toCharArray() method is the simplest and most efficient …

  4. String to Array in Java – How to Convert Strings to Arrays

    Jul 6, 2023 · The toCharArray() method is a built-in function in Java that allows you to convert a string into a character array. This method is available in the String class and provides a …

  5. Convert String to String Array - Baeldung

    Jan 8, 2024 · In this article, we’ve learned how to convert a String to a String array in Java. Simply put, converting a string to a singleton array is pretty straightforward. If we need to break the …

  6. How to convert String to String array in Java - Tpoint Tech

    Let's consider the following example where we use String.split () method to convert a string into a string array. The Java code that is provided shows how to use the split () function to turn a …

  7. Convert a String to Array in Java - Examples Java Code Geeks

    Jan 19, 2021 · In this example, we are going to learn how to convert a string into an array in Java. We are going to discuss three different methods to break a string into an array. 1. Using …

  8. Convert a String to Character Array in Java - Scaler

    May 30, 2022 · Converting String to String Array in Java. We'll learn how to convert a string to an array of strings in Java in this section. In Java, there are four methods to convert a String to a …

  9. How to Convert String to Array in Java | DigitalOcean

    Aug 4, 2022 · String class split(String regex) can be used to convert String to array in java. If you are working with java regular expression , you can also use Pattern class split(String regex) …

  10. Java How To: Convert String to Array - CodeLucky

    In this comprehensive guide, we'll explore several methods to convert a string to an array in Java, complete with practical examples and detailed explanations. We'll cover both character arrays …

Refresh