I need to parse string created from email content and extract data. Structure of a email looks like this:
Some email text..............
//these properties I have to extract
Name: SomeName
Surname: SomeSurname
Email: SomeEmail
Adress: some adress
etc...
Some email text................
Do you know some techniques, how to parse this string and extract data? I find some way but it is defective, becouse it not works when value has whitespace, just like Adress above.
String searchText = "Name:";
int lastIndexOf = content.lastIndexOf(searchText);
String substring = content.substring( 1 + lastIndexOf + searchText.length());
String substring1 = substring.substring(0, substring.indexOf(" "));