Mahalasa Kini
Given a sentence, Reverse all the words in a sentence.

Given a Sentence Ex: “This is India” and your Output should be “sihT si aidnI”

public void ReverseWordsInSentence(String sentence){
String[] words = sentence.Split(“ “);
String reverseSentence =””;

for(int i=0;i0;j—){
reverseword = reverseword+word.CharAt(j);
}
reverseSentence = reverseSentence+ reverseword + “”;
}
}

By Mahalasa Kini in Software Testing on Apr 19 2020

Most Popular Job Functions


MOST LIKED QUESTIONS