android1101 android1101 - 1 year ago 81
Android Question

Separate particular word from string

I have One String
which has value

String someString = "/category/subcategory/Fruit/apple/";

I want to separate "Fruit" from string.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download