I have a string that needs to be chopped up. I’d like to do this in LINQ.
The string can have up to 32 letters.
I’d like to collect the parts in a dictionary.
The 1st part needs to have the first 4 letters.
The 2nd part needs to have the first 5 letters.
The 3rd part needs to have the first 6 letters.
etc.
The key of the dictionary is simply a counter. I don’t know the length of the string, the min. length is 4.
How would I do this createively in LINQ?
You could make it an extension:
Call it in this way: