How to remove all whitespace in a string using Python

afasa

#---------------------------------------------------------------------------
#       Remove the whitespaces within the string.
#---------------------------------------------------------------------------

while user_data != "":
        strip_user_data = []
        for stp in user_data:
                                stp = stp.replace("   ", ",")
                                stp = stp.replace('"', '\'')                               
                                stp = stp.strip('"')
                        strip_user_data.append(stp)
        break

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *

3 × 2 =

Categories