Helper String function to TrimLength

            /// <summary>
            /// If lenght of the string is greater than max allowed, remove the end
            /// </summary>
            /// <param name="str"></param>
            /// <param name="maxLength"></param>
            /// <returns></returns>
            public static string TrimLength(string str, int maxLength)
            {
                if (str.Length > maxLength)
                {
                    str = str.Remove(maxLength);
                }
                return str;
            }

posted @ Monday, June 02, 2008 1:12 PM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 8 and 5 and type the answer here:
 

Live Comment Preview:

 
«September»
SunMonTueWedThuFriSat
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011