You are given an array of characters which is basically a sentence. However there is no space between different words and the first letter of every word is in uppercase. You need to print this sentence after following amendments:
(i) Put a single space between these words.
(ii) Convert the uppercase letters to lowercase.
Input : BruceWayneIsBatman Output : bruce wayne is batman Input : You Output : you
We check if the current character is in uppercase then print ” “(space) and convert it into lowercase.
bruce wayne is batman
This article is contributed by Sahil Chhabra. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Regex in Python to put spaces between words starting with capital letters
- Program to accept String starting with Capital letter
- Find the starting indices of the substrings in string (S) which is made by concatenating all words from a list(L)
- Check if the given string of words can be formed from words present in the dictionary
- Count words that appear exactly two times in an array of words
- Program to print reciprocal of letters
- Length of the longest substring with no consecutive same letters
- Smallest Greater (than S) String of length K whose letters are subset of S
- Check if the string contains consecutive letters and each letter occurs exactly once
- Minimum number of letters needed to make a total of n
- Remove spaces from a given string
- C++ Program to remove spaces from a string
- URLify a given string (Replace spaces is %20)
- Remove extra spaces from a string
- Removing spaces from a string using Stringstream