


Step 3 − For the rest of the characters, if an upper case letter is found, a space character is first displayed.

Step 2 − In case, the pointer is at the first character, it is printed as it is. Step 1 − A for loop is used to iterate through the input string provided. This problem can be solved by character case checking and then its conversion to the opposite case, if required. Some of the examples illustrating the problem statement are as follows − Sample ExampleĮxample 1 - str : : Identify Special characters are also printed as it isĮxplanation: The first letter is printed as it is during the output. In the following problem, the camel case of a given string has to be converted into the sentence case representation. This type of representation is not easily readable, yet it is widely used in programming domain.Īnother type of representation of the string is the sentence case, wherein, the words are separated by a space character and all the words except the first begin with a lowercase letter. Thereby, the upper case letters in this form of representation can be used to segregate the different words. The words are joined together, there is no space character.Įvery word has the first letter stored in upper case. The camel case of a string denotes the string in such a way that the following two properties are maintained − The sentences of a string can be clubbed together in different ways to form different types of representations. It may contains letters, numbers and even special characters. A C++ string is a collection of characters forming words.
