Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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++;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #number #specific #characters #string
ADD COMMENT
Topic
Name
9+8 =