 |
|
ช่วยแนะนำเขียน code vb + function แยกตัวเลขออกจากตัวอักษร |
|
 |
|
|
 |
 |
|
Code (VB.NET)
Dim i, j As Short
Dim arr(1)
For i = 0 To arr.Length - 1
arr(i) = InputBox("input data (" & i & ")")
Next
Dim num, str As String
num = ""
str = ""
For i = 0 To arr.Length - 1
If num <> "" Then num &= ","
If str <> "" Then str &= ","
For j = 1 To Len(arr(i))
If IsNumeric(Mid(arr(i), j, 1)) Then
num &= Mid(arr(i), j, 1)
Else
str &= Mid(arr(i), j, 1)
End If
Next
Next
MsgBox("แยกตัวอักษรและตัวเลข ===========>>> { " & str & "," & num & " }")
|
 |
 |
 |
 |
Date :
2011-11-30 18:56:20 |
By :
Thep |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|