Hallo Community, ich versuche gerade eine kleine App zu schreiben die mir die Molmassen einens Moleküls berechnet. Einfach um ein wenig Erfahrung in C# zu gewinnen. Nun stehe ich vor der Problematik dass ich nicht weiter weiß. Z.B bei der Eingabe von NaCl.Diesen Code habe ich jetzt geschrieben um Z.B. NaCl + HCl später separat weiter verarbeiten zu können. Z.B die Molekülmasse zu berechnen. Im Grunde möchte ich nun, NaCl in Na und Cl trennen. Aber wie kann ich jetzt splitted [0] so trennen, dass, wenn auf ein Großbuchstabe ein kleiner Folgt diese zusammen gehören und Großbuchstaben auch separat gespeichert werden. Wäre dankbar für eure Hilfe:)Code:[FONT=Consolas][FONT=Consolas][FONT=Consolas]string[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] str = myTexteingabe.Text;[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]
[/FONT][/FONT][FONT=Consolas][FONT=Consolas][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]char[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][] split = { [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]' '[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas], [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]'+'[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] };[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]
[/FONT][/FONT][FONT=Consolas][FONT=Consolas][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]string[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][] splitted = str.Split(split);[/FONT][/FONT]