What's the cleanest way to extract fcerdak.jpg in this string
Hi guys. Whats the cleanest way to extract fcerdak.jpg in this string
https://firebasestorage.google ... xx123
https://firebasestorage.google ... xx123
No any search results
You already invited:
2 Answers
Bobby
Upvotes from:
Ezra - Sql
Upvotes from:
So first I would decode the URL using the global decodeURIComponent function. Then I would create a URL object using the global URL constructor, so now I could get the pathname from the instantiated URL object. Since the pathname would be /v0/b/ng-house.appspot.com/o/current-members-logo/cerdak.jpg we can split it in the forward slash, take the last argument and remove the extension.
Here's the code: