I'm creating an iOS project for school and it works with chemical reactions.
The user would have a text field to insert the equation like this:
Fe3O4 + CO = 3FeO + CO2
My goal is to separate this into pieces based on some conditions:
-Finding a capital letter and then testing if the next char is also a capital (e.g.: Fe). -Finding if there's a number after the last char for each element. -Finding a + sign means a different component.
I'm not asking for the code, of course, but I'd appreciate some help.
Thanks in advance.