Question: I'm looking to split a List of Strings up as i iterate throught the list imagine the following as the List.

```
["StringA.StringB.StringC"]["StringA.StringB.StringC"]["StringA.StringB.StringC"]["StringA.StringB.StringC"]

```

So i want to iterate through the list pull out each string (`"StringA.StringB.StringC"`)

Then want to seperate by the `"."` and assign StringA to a String variable - String B to one and String C. Perform some work and move on to the next.

Any ideas how i can do this?

Answer: 
Of course! You just want [`String#split()`](http://download.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String%29).

```
for (String s : myList)
{
    String[] tokens = s.split("\\.");
    // now, do something with tokens
}

```

You need to escape the period in the argument to `split()` because the string is interpreted as a [regex pattern](http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#sum), and an unescaped period (`"."`) will match any character - **not** what you want!
To iterate through a list, see <http://download.oracle.com/javase/tutorial/java/nutsandbolts/for.html>

To split a string, use `String.split(regex)`.