Tai Yo wrote:It is a from Periodic table, element Li (lithium) with atomic number 3 and mass 7.
Well, first, you will need access to the periodic table -- either directly defined in your program, loaded from somewhere such as a file or database, or access via some sort of service.
With that, all you need is to define the parsing rules (consistency of format), so you can parse it, find the element, lookup the atomic number and mass, and generate the result.
Henry