Mega Code Archive

 
Categories / C# / Data Types
 

Truncates the string from left side

//Microsoft Public License (Ms-PL) //http://visualizer.codeplex.com/license using System; using System.Collections.Generic; namespace Redwerb.BizArk.Core.StringExt {     /// <summary>     /// Provides extension methods for strings.     /// </summary>     public static class StringExt     {         /// <summary>         /// Truncates the string.         /// </summary>         /// <param name="str"></param>         /// <param name="length"></param>         /// <returns></returns>         public static string Left(this string str, int length)         {             if (str == null) return null;             if (str.Length <= length) return str;             return str.Substring(0, length);         }    } }