c# - Linq: Search a string for all occurrences of multiple spaces -
i have string , want find position of occurrences of multiple spaces. im writing punctuation checker. parralelise operation using parallel linq in meantime im looking linq method me started.
further fredou's answer, regex nicely. regex.matches returns matchcollection (weakly typed) enumerable. can linq-ified after using cast<t> extension:
regex.matches(input,@" {2,}").cast<match>().select(m=>new{m.index,m.length})
Comments
Post a Comment