Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sentence Editor write a static method sentenceEditor() that accepts a String object as an argument and capitalizes the first character of each sentence in the

Sentence Editor

write a static method sentenceEditor() that accepts a String object as an argument and capitalizes the first character of each sentence in the string. In addition it removes all extra white spaces between words. The resulting changed string is being returned from the method. For instance, if the string argument is "hello.myname is Joe. what is your name?" the method should manipulate the string so it contains "Hello. My name is Joe. What is your name?"

Assume that period, question mark, and exclamation mark are the only signals of the sentence ending.

Suggestion: convert the String into a StringBuilder object to make string modification easier.

Requirement:Make sure to pass through the string only once. Do not use nested loops

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions