0

For example, if I have a string called 'S', split it using .split and store all the words in String[] arr = s.split(" "), how would I modify each word? Let's say I want to remove the first letter and add into the end, then insert some more characters. I know I'll be using StringBuilder class and deleteCharAt, append(), etc..

Ex. Hello World ----> elloHto orldWto

JTurner
  • 1
  • 1

1 Answers1

0
    String input = "Hello World";
    String[] words = input.split(" ");
    for(String s: words){
        System.out.println(s); //do whatever you want
    }
sadat
  • 4,004
  • 2
  • 29
  • 49