Cümledeki Bosluk Sayısını Bulan Program VB.Net
Kullanılan Nesneler:Textbox,Button
[code language=”vbnet”]Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i, bosluk As Integer
For i = 1 To TextBox1.Text.Length
If " " = Mid(TextBox1.Text, i, 1) Then
bosluk = bosluk + 1
End If
Next
If bosluk = 0 Then
MsgBox("Cümlede Bosluk Yok")
Else
MsgBox("Cümledeki Bosluk Sayısı..;" + bosluk.ToString)
End If
End Sub
[/code]

Dim a() As String = TextBox1.Text.Split(” “)
MsgBox(a.Length)