-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,115
  • 11
  • 16
Sri Test
  • 369
  • 3
  • 18

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
  • 17,542
  • 5
  • 40
  • 65
tbw3
  • 82
  • 7