How does python delete all empty characters in a string?

for example, "158.2.0.36 <-- 5.5.0.36" is converted to "158.2.0.36 <-- 5.5.0.36"


(Pdb) p s1_list
"158.2.0.36 <--   5.5.0.36"
(Pdb) p s1_list.strip()
"158.2.0.36 <--   5.5.0.36"
(Pdb) p s1_list.strip("")
"158.2.0.36 <--   5.5.0.36"
(Pdb) p s1_list.strip(" ")
"158.2.0.36 <--   5.5.0.36"
(Pdb) p s1_list.strip("") 
"158.2.0.36 <--   5.5.0.36"
(Pdb) p s1_list.strip("")
Feb.28,2021

strip is the character that deletes the beginning and end. Similarly, lstrip deletes the first part, and rstrip deletes the tail

. For more information, please see python.org/3/library/stdtypes.html-sharpstr.strip" rel=" nofollow noreferrer "> https://docs.python.org/3/lib.

.

you can use replace

>>> '158.2.0.36 <-- 5.5.0.36'.replace(' ', '')
'158.2.0.36<--5.5.0.36'
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ead438-2145.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ead438-2145.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?