Thursday, July 18, 2013

Count Word Without space C#

Count  Word Without Space

public static int ContWordWithOutSpace(string value)
    {
        //Content Length-Content Description

        int length = 0;
        value = value.Trim();
        string value1 = CollapseSpaces(value);
        char[] lineDelimiters = { ' ', '\n', '\r' };
        string[] arr = value1.Split(lineDelimiters);
        length = arr.Length;
        int lgth = value.Length;
        return length;
    }

No comments:

Post a Comment