Guest User

Molecularweight

a guest
Nov 24th, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. private void Molvaegtberegner()
  2. {
  3. string input = ChemicalformulaTextbox.Text;
  4.  
  5. string pattern = @"([A-Z][a-z]?\d*|[A-Z]?\d*)";
  6.  
  7. string[] substrings = Regex.Split(input, pattern);
  8.  
  9. foreach (string match in substrings)
  10. {
  11. if (match != "")
  12. {
  13. //Calculate Molecularweight here
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment