LJ3*_*LJ3 2 python string python-3.x
我需要转换字符串:
"There are 6 spaces in this string."
Run Code Online (Sandbox Code Playgroud)
至:
"Thereare6spacesinthisstring."
Run Code Online (Sandbox Code Playgroud)
wkl*_*wkl 11
您可以使用 replace
string = "There are 6 spaces in this string"
string = string.replace(' ', '')
Run Code Online (Sandbox Code Playgroud)