Quantcast
Channel: DotNetNuke – Michael Freidgeim's Blog
Viewing all articles
Browse latest Browse all 10

Helper String function to TrimLength

$
0
0

            /// <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;
            }


Viewing all articles
Browse latest Browse all 10

Trending Articles