Hi guys - so basically I have an issue. The tokenizer I wrote works, but only for the reactant part. The issues arise in the product part. For reasons for me unknown, when it gets to NaOH, it only registers Na and fetches the atomic mass of sodium from the database. Since the loop is a foreach and there were still two characters lefy, I don't understand why the code chose to ignore the rest. Any ideas how to solve this? Link to the tokenizer: https://pastebin.com/SKr4rvZP
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.