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 : GeeksForGeeks Output : geeks for geeks
We have existing solution for this problem, please refer Put spaces between words starting with capital letters link.
- Split each word starting with capital letter using re.findall(expression, str) method.
- Now change capital letter of each word to lowercase and concatenate each word with space.
bruce wayne is batman
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Put spaces between words starting with capital letters
- Python - Eliminate Capital Letter Starting words from String
- Python Regex - Program to accept string starting with vowel
- Program to accept String starting with Capital letter
- Python regex to find sequences of one upper case letter followed by lower case letters
- Python - Get number of characters, words, spaces and lines in a file
- 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)
- Python | First N letters string construction
- Python | Remove all characters except letters and numbers
- Python | Insert value after each k letters in given list of string
- Python | Ways to sort letters of string alphabetically
- Verbose in Python Regex
- Python | Check for spaces in string
- Python | Remove spaces from a string
- Color Spaces in OpenCV | Python
- Python Regex: re.search() VS re.findall()
- Name validation using IGNORECASE in Python Regex
- Pattern matching in Python with Regex
- Python | Remove spaces from dictionary keys
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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.