Editar

Compartilhar via


StringExtensions.Count(String, Char) Method

Definition

Counts the number of occurrences of a given character into a target String instance.

public static int Count (this string text, char c);
static member Count : string * char -> int
<Extension()>
Public Function Count (text As String, c As Char) As Integer

Parameters

text
String

The input String instance to read.

c
Char

The character to look for.

Returns

The number of occurrences of c in text.

Applies to