Question: I am trying to parse the certain name from the filename.

The examples of File names are 

```
xs_1234323_00_32

sf_12345233_99_12

fs_01923122_12_12

```

I used `String parsedname= child.getName().substring(4.9)` to get the 1234323 out of the first line. Instead, how do I format it for the above 3 to output only the middle numbers(between the two \_)? Something using `split`?

Answer: 
```
String [] tokens = filename.split("_");
/*  xs_1234323_00_32 would be
      [0]=>xs   [1]=> 1234323   [2]=> 00  [3] => 32
*/
String middleNumber = tokens[2];

```
The [String.split](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String%29) methods splits this string around matches of the given ;parameter. So use like this

```
String[] output = input.split("_");

```

here `output[1]` will be your desired result

ANd input will be like

```
String input = "xs_1234323_00_32"

```