The conversation between human and AI assistant.
How do convert string to string array in Java?
Certainly. It's "apple, banana, orange, pear".
Great. Here's how you can convert it to a string array:

String[] fruits = "apple, banana, orange, pear".split(", ");

Now 'fruits' is an array that contains the individual elements "apple", "banana", "orange", and "pear". Is there anything else that you need help with?