How many times is this used?
If you want to check how many times a specific character appears in a given string, please refer to the following.
Example:
"I graduated from high school and university and now teach at a junior high school as a teacher. School life is quite enjoyable."
I want to get the number→school
Dim mojiretu As String = ""
Dim kensaku As String = ""
Dim mojilength As Integer = 0
Dim kaisuu As Integer = 0
mojiretu ="I graduated from high school and university and now teach at a junior high school as a teacher. School life is quite enjoyable."
kensaku = "school"
mojilength = mojiretu.Length
For i = 0 To mojilength - 2
If mojiretu.Substring(i, 2) = "school" Then
kaisuu = kaisuu + 1
End If
Next
MessageBox.Show(”How many times:” & kaisuu)