Guest User

Untitled

a guest
May 16th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1.             string satz = "hallo till 123 penis 45 blub alpha gamma 999";
  2.  
  3.             string[] wörter = satz.Split(' ');
  4.             // { "hallo", "till", "123", "penis", ... }
  5.  
  6.             double x; // platzhalter
  7.            
  8.             string[] zahlen = wörter.Where(s => Double.TryParse(s, out x)).ToArray();
  9.             // { "123", "45", "999" usw }
  10.  
  11.             // für nicht zahlen einfach vor die kondition ein ! setzen
Add Comment
Please, Sign In to add comment