I am trying to seperate or removing a string.
Here the example:
String sample = "https://xyz-api.portal.com/";
i want to get only "xyz-api", this string and want to store a variable,
the expected output =
String result = "xyz-api"
How to do that, i am confusing this string conversion, please help
3
Answers
You can use the Uri class.
Result: xyz-api
You can do it like this:
You can do it like this: