Sdl.Web.Common/Extensions/StringExtensions.cs
/// <summary>
/// Returns true if a string contains N or more characters 'c'.
/// </summary>
Returns true if a string contains N or more characters 'c'.
Returns true if a string contains N or more characters ' c ' .
public static bool HasNOrMoreOccurancesOfChar(this string str, int n, char c)
        {
            int count = 0;
            for (int i = 0; i < str.Length || count >= n; i++)
            {
                if (str[i] == c)
                {
                    count++;
                }
            }
            return count >= n;
        }
public static bool HasNOrMoreOccurancesOfChar ( this string str , int n , char c ) { int count = 0 ; for ( int i = 0 ; i < str . Length || count >= n ; i ++ ) { if ( str [ i ] == c ) { count ++ ; } } return count >= n ; }
Returns true if a string contains N or more characters 'c'.
Returns true if a string contains N or more characters ' c ' .
string
this
n
int
c
char