如何获取textbox1上的第8个数字? [英] How to get the 8th number on textbox1 ?
本文介绍了如何获取textbox1上的第8个数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在textbox1上获得第8个号码?我需要写的是这样的。
How do i get the 8th number on textbox1? What i need to write is something like this.
If 8th number on textbox1 = 0 then
msgbox("OK")
else
msgbox("INVALID")
end if
请帮忙。谢谢。
Please help. Thank you.
推荐答案
这并不困难:
This is not exactly difficult:
Dim numbers as String
numbers = textbox1.Text
if numbers.length = 8 And numbers(7) = '0' Then
msgbox("OK")
// etc.
作为 Richard MacCutchan [ ^ ]提到,它很漂亮很简单。
VB.NET使用 String.Substring Method(System) [ ^ ]获取字符串的一部分。
试试!
有关字符串操作的更多信息,请参阅:字符串操作摘要(Visual Basic) [ ^ ]
As Richard MacCutchan[^] mentioned, it's pretty easy.
VB.NET uses String.Substring Method (System)[^] to get part of string.
Try!
For further information about string manipulation, please see: String Manipulation Summary (Visual Basic)[^]
感谢您提示。解决了它。这就是我做的。
Dim x As String
x = TextBox1.Text
txttype.Text = Mid
Thank you for the tips guys. Solved it. This is what i did.
Dim x As String
x = TextBox1.Text
txttype.Text = Mid
这篇关于如何获取textbox1上的第8个数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文