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...
Popular interview questions of Software Developer Intern
A Software Developer Intern was asked Q1. Buy and Sell Stock Problem Statement Imagine you are Harshad Mehta's friend, and...read more
A Software Developer Intern was asked Q2. Convert Sentence to Pascal Case Given a string STR, your task is to remove space...read more
A Software Developer Intern was asked Q3. Generate Possible Words from T9 Keypad Given a string S consisting of digits fro...read more
>
EX Squared Solutions Software Developer Intern Interview 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

