Reputation: 5
I have One String which has value
String someString = "/category/subcategory/Fruit/apple/";
I want to separate "Fruit" from string.
Upvotes: 0
Views: 71
Reputation: 155
Make an Array
of Strings
by splitting with /
character like:
String[] split = someString.split("/");
This Array split[]
has all the elements separated. You can use whichever you want.
Upvotes: 2