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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Regex in Python to put spaces between words starting with capital letters
- Program to accept String starting with Capital letter
- Sort numbers based on count of letters required to represent them in words
- Find the starting indices of the substrings in string (S) which is made by concatenating all words from a list(L)
- Count words that appear exactly two times in an array of words
- Check if the given string of words can be formed from words present in the dictionary
- Minimum cost to remove the spaces between characters of a String by rearranging the characters
- Check if the string contains consecutive letters and each letter occurs exactly once
- Program to print reciprocal of letters
- Smallest Greater (than S) String of length K whose letters are subset of S
- Make palindromic string non-palindromic by rearranging its letters
- Minimum number of letters needed to make a total of n
- Length of the longest substring with no consecutive same letters
- Minimum letters to be removed to make all occurrences of a given letter continuous
- Construct a string of length L such that each substring of length X has exactly Y distinct letters
- Remove spaces from a given string
- Remove extra spaces from a string
- Removing spaces from a string using Stringstream
- C++ Program to remove spaces from a string
- Move spaces to front of string in single traversal