StringStream search and delete

Hi. I'm trying to make an electron notation maker. If anyone knows Quantum Physics, what I am trying to do is a calculator that displays electron notation as a noble gas notation. For example, Chlorine's electron configuration is 1s2, 2s2, 2p6, 3s2, 3p5. Now, the noble gas before that is Neon.

So basically I want to search my string for:
1s2, 2s2, 2p6

and replace it with:
[Ne]

So then the whole string will go from:
1s2, 2s2, 2p6, 3s2, 3p5

to:
[Ne], 3s2, 3p5

with ", 3s2, 3p5" untouched.
Thanks for the links. Now I'll just need to figure out which form of replace is right for my application.
Topic archived. No new replies allowed.