Hello, I have a little question, I need to write a function which receives a string as a parameter (like molecular formula "H2O, C6H12O6, ..." ) and has to do 2 things:
1: has to check that an element always starts with a capital letter and may be followed by a single lower case character like Fe2O3
2:the abscence of a number indicates a single atom of that element. for example CO2
I was thinking of using string length method but don't seem to have any luck, any ideas?