substring with linq??

Posted by phenevo on Stack Overflow See other posts from Stack Overflow or by phenevo
Published on 2010-03-08T15:48:08Z Indexed on 2010/03/08 15:51 UTC
Read the original article Hit count: 306

Filed under:
|
|

I've got collection of words, and i wanna create collection from this collection limited to 5 chars

Input:

Car
Collection
Limited
stackoverflow

Output:

car
colle
limit
stack

word.Substring(0,5) throws exception (length)

word.Take(10) is not good idea, too...

Any good ideas ??

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ