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
4mo
Convert a given string to Pascal case format by removing spaces and capitalizing the first letter of each word.
Iterate through each character in the string
If the character is a space, skip it
If the ch...read more
Help your peers!
Add answer anonymously...
Oracle Software Developer interview questions & answers
A Software Developer was asked 7mo agoQ. What is testing? Explain the different types of testing.
A Software Developer was asked 9mo agoQ. Given an array containing duplicate elements, remove the duplicates while mainta...read more
A Software Developer was asked 9mo agoQ. The count-and-say sequence is a sequence of digit strings defined by the recursi...read more
Popular interview questions of Software Developer
A Software Developer was asked 6mo agoQ1. Explain Linux system calls with an example.
A Software Developer was asked 7mo agoQ2. What is testing? Explain the different types of testing.
A Software Developer was asked 9mo agoQ3. Given an array containing duplicate elements, remove the duplicates while mainta...read more
Top HR questions asked in Oracle Software Developer
A Software Developer was asked 5mo agoQ1. Tell me about your work experience.
A Software Developer was asked 5mo agoQ2. What are your strengths?
A Software Developer was asked 5mo agoQ3. Can you tell me about yourself?
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

