Answers for "how to add space before capital letter in python"

0

how to add space before capital letter in python

text = 'WordWordWord'
new_text = ''

for i, letter in enumerate(text):
    if i and letter.isupper():
        new_text += ' '

    new_text += letter
Posted by: Guest on April-26-2021

Code answers related to "how to add space before capital letter in python"

Python Answers by Framework

Browse Popular Code Answers by Language