Perhaps these 2 tiny methods I'm sharing here come handy to someone.
Code:
public static string Left(this string input, int length) {
string result = input;
if (input != null && input.Length > length) {
result = input.Substring(0, length);
}
return result;
}
public static string Right(this string input, int length) {
string result = input;
if (input != null && input.Length > length) {
result = input.Substring(input.Length - length, length);
}
return result;
}