Showing posts with label Trim string C#. Show all posts
Showing posts with label Trim string C#. Show all posts

Monday, February 15, 2010

Trim a string to a specified length, C#

Trim a string to a length, Here

        public  string TrimString(string strValue,int Count)
        {           
            if (strValue.Length > Count)
            {
                strValue = strValue.Substring(0, Count - 1) + "..";
            }
            return strValue;
        }