Question: need to separate the string,i need to separate it.The String is dynamically add.

For Example 

```
1.String a="C:\Wowza Media Systems\Wowza Media Server 2.2.3\content\user2\weight.mp4" 

```

i need to separate it **user2**

```
2. String a="C:users\Wowza Media Systems\Wowza Media Server 2.2.3\content\user2\sample.flv"

```

So i added the value dynamically for **a**, but i need to separate the string before **weight.mp4** after **content** .

Answer: 
You just want to substring the sequence between two last slashes. Look at methods 'lastIndexOf' and 'substring' of String class.
```
String end = a.substring(a.lastindexof("\\"),a.length); // <- get the end
String tmp = a.substring(0,a.lastindexof("\\"));  // <- get the rest
String start = tmp.substring(0,a.lastindexof("\\"); // <- get the start

```

I'm shure the code above have some syntax errors and in the first line you have to add 1 to the lastindexof perhaps. But it gives you an idea to solve your problem.