4 ms·
In Python, I'd use use a generator comprehension and str.title(). Assuming I haven't screwed up, then it's just: new_string = "".join(word.title() for word
by kylebgorman 11y ago
In Python, I'd use use a generator comprehension and str.title(). Assuming I haven't screwed up, then it's just:
new_string = "".join(word.title() for word in long_string.split(" "))
- brbsix 11y agoAgreed. My first thought was to use `new_string = long_string.title().replace(' ', '')` or the generator you mentioned.