在vb.net中读取前10个字符 [英] reading first 10 character in vb.net
本文介绍了在vb.net中读取前10个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好我有字符串,那个字符串看起来像这样
'01 / 08 / 201100000001000134625DANA NABEEL GHAREEB 19011110'
来自上面的字符串我想读前10个字符。我该怎么办呢。
给我一些示例代码以上
hi all i have string, that string will look like this
'01/08/201100000001000134625DANA NABEEL GHAREEB 19011110 '
from the above string i want to read first 10 character. how shall i do this.
give me some sample code for above this
推荐答案
试试:
Try:
Dim source As String = "01/08/201100000001000134625DANA NABEEL GHAREEB 19011110"
Dim cutdown As String = source.Substring(0, 10)
Public Function GetFirstTenChars(ByVal Str As String) As String
return Str.Substring(0,10)
'xD
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim mystring As String = "01/08/201100000001000134625DANA NABEEL GHAREEB 19011110"
GetFirstTenChars(mystring)
End Sub
试试这个:D :D:D
Try this :D :D :D
这篇关于在vb.net中读取前10个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文