SyntaxFix
Write A Post
Hire A Developer
Questions
string truncatedToNLength = new string(s.Take(n).ToArray());
This solution has a tiny bonus in that if n is greater than s.Length, it still does the right thing.