Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このような:
愛している => 愛している
2 つの単語の間にスペースを追加するだけです。
両方の単語が大文字の場合、
import re re.sub(r'([a-zA-Z])([A-Z])', r'\1 \2', 'ILove') # => 'I Love'
これは基本的に、大文字の前に文字があれば、大文字の前にスペースを挿入します。