02-12-12, 12:22 AM
نحمده ونصلي على رسوله الكريم
كود :
[align=left]Dim str() As Char = TextBox1.Text.ToCharArray()
Dim dot As Single = 0
Dim comma As Single = 0
For Each c As Char In str
If c = "." Then
MessageBox.Show("نقطة")
dot += 1
End If
If c = "," Or c = "،" Then
MessageBox.Show("فاصلة")
comma += 1
End If
Next
MessageBox.Show(String.Format("عدد النقاط: {0}" & vbCrLf & "عدد الفواصل: {1}", dot.ToString(), comma.ToString()))
[/align]