Answers for "split a string by a character into a list java"

2

split every character in string into array java

String s="abcd";
char[] a=s.toCharArray();
Posted by: Guest on March-05-2020
0

split each character in a string (java)

class Test {
         public static void main( String[] args) {
             String[] result = "Stack Me 123 Heppa1 oeu".split("\\a");                                                                                   

             // output should be
             // S
             // t
             // a
             // c
             // k
             // M
             // e
             // H
             // e
             // ...
             for ( int x=0; x<result.length; x++) {
                 System.out.println(result[x] + "\n");
             }
         }
     }
Posted by: Guest on December-15-2020

Code answers related to "split a string by a character into a list java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language