如何使用vb.net检查文本框中逗号之间的10位数移动电话号码 [英] how to check 10 digit mobile number between comma in textbox using vb.net

查看:100
本文介绍了如何使用vb.net检查文本框中逗号之间的10位数移动电话号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在文本框中有一些如下数字



9856321470,1235647809,9847562155,9563256985,8452136547



i需要检查两个逗号之间的给定数字是10位数。

谢谢。



表示我想要验证在两个逗号之间,这个数字有10位数。

如果两个逗号之间的数字不包含10位,则会产生错误。

解决方案

< blockquote>

[ ^ ]

查看此链接..确保有用u

如果没有那么请问!


试试这个:

 TextBox1.Text =   9856321470,123564780,9847562155,956325698,8452136547 

Dim text As String ()= TextBox1.Text.Split( C)

对于i as Integer = 0 至text.Length - 1

如果text(i).Length = 10 那么

ElseIf text(i).Length<> 10 然后
// 错误信息在这里
结束如果
下一步


参考这个

字符串拆分


i have some numbers like below in textbox

9856321470,1235647809,9847562155,9563256985,8452136547

i need to check that given number between two commas is in 10 digit..
thank you.

means i want to validation that between two commas, the number has 10 digit.
if between two commas number doesn't contain 10 digit the it will give error.

解决方案


[^]
See this link..Sure will help u
If not then ask!


Try this:

TextBox1.Text = "9856321470,123564780,9847562155,956325698,8452136547"

Dim text As String() = TextBox1.Text.Split(","C)

For i As Integer = 0 To text.Length - 1

	If text(i).Length = 10 Then
			
	ElseIf text(i).Length <> 10 Then
        //error message here
	End If
Next


Refer this
String Split


这篇关于如何使用vb.net检查文本框中逗号之间的10位数移动电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆