In the given solution they don't use substring but a char array. Is it because of this?
package de.codegym.task.task08.task0823;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
/*
Landesweite Restaurantkette
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
//schreib hier deinen Code
String[] words = s.split("[. ;:,]");
for(int i = 0; i < words.length; i++){
String firstLetter = words[i].substring(0,1).toUpperCase();
String restWord = words[i].substring(1);
String word = firstLetter+restWord;
words[i] = word;
}
for(String element : words){
System.out.print(element+" ");
}
}
}