string s = "How are you doing?"; int count = (from char c in s.ToCharArray() where c.Equals('o') select c).Count();
Dim s As String = "How are you doing?" Dim count As Integer = (From c As Char In s.ToCharArray() _ Where c.Equals("o"c) _ Select c).Count()
Dim s As String = "How are you doing?" Dim Counter As Integer = 0 Dim CharToCount As Char = "o" For i As Integer = 0 To s.Length - 1 If s.Substring(i, 1) = CharToCount Then Counter += 1 Next MsgBox(Counter)
Dim s As String = "How are you doing?" Dim Count As Integer = (From c As Char In s.ToCharArray Where c.Equals("o"c) Select c).Count
YourText.Split("c").Length - 1
Text = abcdcbac <br /> Split = ab,d,ba,<blank>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)