我有一个多行打印的字符串值。我使用三个单/双引号来分配字符串值
artist = """
Mariah
Carey
"""
name = 'My all'
realeased_year = 1997
genre = 'Latin'
duration_seconds = 231
print(f'{artist}(full name has {len(artist.strip().replace(" ", ""))} characters) and her song \'{name}\' was released in {realeased_year + 1}')
但是,当我在一行中分配一个字符串值时
artist = 'Mariah Carey'
是否可以在不使用正则表达式的情况下从多行字符串值中删除所有空格(前导、中间和尾随)