Question Index

Write a program to find the words starting with letter 'r' in a given sentence.

Input (String) Output (List)
ravana was killed by rama. [ravana, rama]
I like Ramakrishna Paramahamsa. He was a famous mystic of 19th century India [Ramakrishna]
Sun rises in the east [rises]
Learn Java with Merit Campus []

class FindWordsStartingWithLetterR

{    public static void main(String s[])
        String sentence = "this is the time to review your programs yourself";
        System.out.println("The words starting with letter 'r' are : " + getWordsStartingWithLetterR(sentence));


public static List<String> getWordsStartingWithLetterR(String sentence) {
//Write a code here to get the words starting with 'r' and return them as a List.



Topic: Java ArrayList

Read this topic
Take test on this topic

Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App