I am passing an URL with validating the slash in end index. But the problem is the slash may be present or not. so I need to pas only url wheather the slash in last index prsent or not.
The URL may be like
https://www.instagram.com/example/ (with slash endIndex) or
https://www.instagram.com/example (without slash endIndex)
I need the URL as only
https://www.instagram.com/example (without slash)
Thanks for your help