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.
Be the first one to answer
Add answer anonymously...
Top EX Squared Solutions Software Developer Intern interview questions & answers
Popular interview questions of Software Developer Intern
>
EX Squared Solutions Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app