23 lines
485 B
C#
23 lines
485 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MontoyaTech.Rest.Net
|
|
{
|
|
internal static class StringExtensions
|
|
{
|
|
public static int Count(this string input, char c)
|
|
{
|
|
int count = 0;
|
|
int len = input.Length;
|
|
for (int i = 0; i < len; i++)
|
|
if (input[i] == c)
|
|
count++;
|
|
|
|
return count;
|
|
}
|
|
}
|
|
}
|