I believe that you are using ASCII to approximate the chemical formula, which really does depend on subscripts to be accurate. I'm simply being facetious in the GP, but superscript is really beyond inaccurate, IMHO. Superscript means other things entirely. Don't you agree that's more confusing than collapsing it into ASCII?
The Simplified Molecular Input Line Entry System (SMILES) is a specification in the form of a line notation for describing the structure of chemical species using short ASCII strings. SMILES strings can be imported by most molecule editors for conversion back into two-dimensional drawings or three-dimensional models of the molecules.
Double, triple, and quadruple bonds are represented by the symbols =, #, and $ respectively as illustrated by the SMILES O=C=O (carbon dioxide...)
O2 is the oxygen gas molecule. Two oxygen atoms stuck together. CO2 is carbon dioxide, a molecule with one carbon atom and two oxygen atoms.
I believe that you are using ASCII to approximate the chemical formula, which really does depend on subscripts to be accurate. I'm simply being facetious in the GP, but superscript is really beyond inaccurate, IMHO. Superscript means other things entirely. Don't you agree that's more confusing than collapsing it into ASCII?
https://en.wikipedia.org/wiki/Chemical_formula
https://en.wikipedia.org/wiki/Simplified_Molecular_Input_Lin...
The Simplified Molecular Input Line Entry System (SMILES) is a specification in the form of a line notation for describing the structure of chemical species using short ASCII strings. SMILES strings can be imported by most molecule editors for conversion back into two-dimensional drawings or three-dimensional models of the molecules.
Double, triple, and quadruple bonds are represented by the symbols =, #, and $ respectively as illustrated by the SMILES O=C=O (carbon dioxide...)