Horje
count number of specific characters in string c# Code Example
find character from string c# count
int count = Regex.Matches(test, "word").Count;
count number of specific characters in string c#
string source = "/once/upon/a/time/";
int count = 0;
foreach (char c in source) 
  if (c == '/') count++;
count number of specific characters in string c#
# cCopyusing System;
using System.Linq;

namespace get_first_char_of_string
{
    class Program
    {
        static void Main(string[] args)
        {
            string source = "/once/upon/a/time/";
            int count = source.Split('o').Length - 1; 
            Console.WriteLine(count);
        }
    }
}




Csharp

Related
datetime empty date Code Example datetime empty date Code Example
System.Data.Entity.Core.EntityException: The underlying provider failed on Open Code Example System.Data.Entity.Core.EntityException: The underlying provider failed on Open Code Example
How can I display image from database in asp.net mvc. I created image table and image path as varchar Code Example How can I display image from database in asp.net mvc. I created image table and image path as varchar Code Example
C#  async to sync Code Example C# async to sync Code Example
log4net.config configuration Code Example log4net.config configuration Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10