C#: Limit the length of a string?

Viewed 193048

I was just simply wondering how I could limit the length of a string in C#.

string foo = "1234567890";

Say we have that. How can I limit foo to say, 5 characters?

11 Answers
Related