Split Each Character In A String Java

[Solved] Split Each Character In A String Java | Swift - Code Explorer | yomemimo.com
Question : split every character in string into array java

Answered by : xenophobic-xenomorph-tyzvetbbcynk

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

Source : https://www.quora.com/How-do-you-split-a-word-in-Java | Last Update : Thu, 12 Mar 20

Question : split string into words java

Answered by : william-r67a6wa4xyur

import java.util.Arrays;
class test{ public static void main(String[] args) { String sentence = "this is a sentence!"; String[] words = sentence.split(" "); for (String word : words) { System.out.println(word); } }
}

Source : | Last Update : Fri, 30 Dec 22

Answers related to split each character in a string java

Code Explorer Popular Question For Swift