Search code examples
pythonstringurlnormalization

How can we remove first element and spaces between them in a string in python?


How can I remove first element and all spaces in this string?

url = '1    https://coinmarketcap.com/historical/20220109/'

Solution

  • Your problem has solved

    url = '1    https://coinmarketcap.com/historical/20220109/'
    print(url)
    print(url[1:].strip())
    
    #assign to another variable if need 
    new_url = url[1:].strip()
    
    print(new_url)