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

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -