I've been working with strings in vuejs and currently have 4 URL strings:
https://web-sand.com/product/slug/apple-iphone-13
https://web-sand.com/product/slug/samsung-galaxy
https://web-sand.com/product/slug/xiaomi-red
https://web-sand.com/product/slug/apple-ipad
My goal is to process these strings to extract the final string. Since the length of my strings varies, using fixed methods is not efficient. The desired result is :
apple-iphone-13
samsung-galaxy
xiaomi-red
apple-ipad
If anyone has any comments or suggestions, I would greatly appreciate it. Thank you.