Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string satz = "hallo till 123 penis 45 blub alpha gamma 999";
- string[] wörter = satz.Split(' ');
- // { "hallo", "till", "123", "penis", ... }
- double x; // platzhalter
- string[] zahlen = wörter.Where(s => Double.TryParse(s, out x)).ToArray();
- // { "123", "45", "999" usw }
- // für nicht zahlen einfach vor die kondition ein ! setzen
Add Comment
Please, Sign In to add comment