Question: How do I convert the following `String` to a `Person` object ?

String content:
---------------

```
String testString = "John|23;Ron|22;Don|32"

```

Person class:
-------------

```
public class Person{
   private String name;
   private String age;
   //getters and setters for name and age
}

```

Is there any utility class to convert the testString to Person objects based on the delimiters ";" and "|"

Answer: 
No, you have to write your own parser, because no one could know why to associate the first value to "name" and the second one to "age" - although Reflection could help, but that would be a big overhead for such a task.

For parsing, you could first split at ";" and then for every split array element, split at "|", iterate this array and fill the `Person` according to the array iteration.
This might be done in that way. 

```
 public class Person{
      private String name;
      private String age;

        public Person(){}:

       public static List<Person> gerPersons(String personString){
            List<Person> result = new ArrayList<Person>();
            String[] presonsTab = personString.split(";");
            for(String p : personsTab){
              Person person = new Person();
              String personTab = p.split("|");
              if(personTab.length!=2)
                 throw new RuntimeException("Provide proper String");
              person.setName(personTab[0]);
              person.setAge(personTab[1]);
              result.add(person);

          }
          return result;

        }

        public void setName(String n){ this.name = n;}
        public void setAge(String a){this.age = a;}

  }

```