Convert Sentence to Pascal Case
Given a string STR
, your task is to remove spaces from STR
and convert it to Pascal case format. The function should return the modified STR
.
In Pascal case, words are concatenated without spaces, and each word starts with an uppercase letter, including the first word.
Input:
The first line contains an integer T
, the number of test cases. Each of the next T
lines contains a separate test case string STR
.
Output:
For each test case, return the string converted to Pascal case. Each output should be on a new line.
Example:
Input:
2
hello world
convert this string
Output:
HelloWorld
ConvertThisString
Constraints:
1 ≤ T ≤ 5
1 ≤ |STR| ≤ 10^5
, where|STR|
is the length of each input string.
Note:
The input string STR
consists only of lowercase English letters without leading or trailing whitespace.
Implementation focuses solely on processing; output generation is managed externally.

AnswerBot
2mo
Convert a given string to Pascal case by removing spaces and capitalizing the first letter of each word.
Input Handling: Read the number of test cases and each string to be processed.
String Manipulatio...read more
Help your peers!
Add answer anonymously...
Interview Questions Asked to Software Developer Intern at Other Companies
Top Skill-Based Questions for EX Squared Solutions Software Developer Intern
C++ Interview Questions and Answers
300 Questions
Algorithms Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Web Development Interview Questions and Answers
250 Questions
Operating Systems Interview Questions and Answers
250 Questions
System Design Interview Questions and Answers
250 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

