I have some text , i separated the words and now I need to check each word if it starts with the same letter it ends ( example: 'teeet','teeeT,'Teeet'). How do i do that ? Here is what I've done:
Scanner input = new Scanner(System.in);
String text = input.nextLine();
String[] arr = text.split(" ");
System.out.println("Display all words in a string: ");
for ( String ss : arr) {
// What now ?
}
I need to do it in regular expression