vb 判断text1.text中的数字大于一个数值就删掉
如text1.text中的数字有10,1,400,-3,3.42,8,50,~~要求大于100的数字就不要,小于0的就不要,不是整数就不要~得的数是:10,1,8,50,...
如text1.text中的数字有10,1,400,-3,3.42,8,50,~~要求大于100的数字就不要,小于0的就不要,不是整数就不要~
得的数是:10,1,8,50,我想实现这个效果~~朋友帮帮 展开
得的数是:10,1,8,50,我想实现这个效果~~朋友帮帮 展开
2个回答
展开全部
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a() As String
Dim b() As String
Dim i As Integer
Dim s As String
a = Split(TextBox1.Text, ",")
For i = LBound(a) To UBound(a)
b = Split(a(i), ".")
If a(i) > 100 Or a(i) < 0 Or a(i) - b(0) <> 0 Then
Else
s = s & a(i) & ","
End If
Next
TextBox1.Text = s
End Sub
vb.net的代码 经过调试通过.
Dim a() As String
Dim b() As String
Dim i As Integer
Dim s As String
a = Split(TextBox1.Text, ",")
For i = LBound(a) To UBound(a)
b = Split(a(i), ".")
If a(i) > 100 Or a(i) < 0 Or a(i) - b(0) <> 0 Then
Else
s = s & a(i) & ","
End If
Next
TextBox1.Text = s
End Sub
vb.net的代码 经过调试通过.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Click()
a = Split(Text1, ",")
For i = LBound(a) To UBound(a)
b = Split(a(i), ".")
If a(i) > 100 Or a(i) < 0 Or a(i) - b(0) <> 0 Then
Else
s = s & a(i) & ","
End If
Next
Text1 = s
End Sub
a = Split(Text1, ",")
For i = LBound(a) To UBound(a)
b = Split(a(i), ".")
If a(i) > 100 Or a(i) < 0 Or a(i) - b(0) <> 0 Then
Else
s = s & a(i) & ","
End If
Next
Text1 = s
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询