Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Molvaegtberegner()
- {
- string input = ChemicalformulaTextbox.Text;
- string pattern = @"([A-Z][a-z]?\d*|[A-Z]?\d*)";
- string[] substrings = Regex.Split(input, pattern);
- foreach (string match in substrings)
- {
- if (match != "")
- {
- //Calculate Molecularweight here
- }
- }
- }
Add Comment
Please, Sign In to add comment