With regular use of StringBuilder, you may see the need to combine AppendFormat() and AppendLine().
public static void AppendFormatLine(this StringBuilder sb, string format, params object[] args)
{
sb.AppendFormat(format, args);
sb.AppendLine();
}
Also, since I'm converting an application from VB6 to C#, the following are very useful to me:
public static string Left(this string s, int length)
{
if (s.Length >= length)
return s.Substring(0, length);
throw new ArgumentException("Length must be less than the length of the string.");
}
public static string Right(this string s, int length)
{
if (s.Length >= length)
return s.Substring(s.Length - length, length);
throw new ArgumentException("Length must be less than the length of the string.");
}