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 email@example.com. 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
- 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
- URLify a given string (Replace spaces is %20)
- Removing spaces from a string using Stringstream
- Remove extra spaces from a string
- C++ Program to remove spaces from a string
- How to remove all white spaces from a String in Java?
Improved By : Sam007