-1

I have a list of urls of the following format:

https://doi.org/10.1145/2883851.2883900

I want to extract the values after "doi.org".Here in the example my expected output is:

10.1145/2883851

I could do it on single url but to apply how get the values from a list of URLs.

John
  • 1,335
  • 12
  • 17
Sri Test
  • 389
  • 1
  • 4
  • 21

1 Answers1

2

If you have a list of urls with the same domain name and want to return a list of values in 10.1145/2883851 format :

def replace_url(urls):
    result = []
    for url in urls:
        result.append(url[16:]) # len of "https://doi.org/" is 16
    return result 
Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
tbw3
  • 82
  • 8