簡(jiǎn)單,思路:
樊城網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián)公司,樊城網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為樊城上千余家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的樊城做網(wǎng)站的公司定做!
1、將每行數(shù)據(jù)放到數(shù)組
2、把”:“作為分隔符拿到你想要的字符串
程序如下:
dim?ArrTemp()?as?string
ArrTemp=split(你的這堆字符,vbcrlf)
dim?i?as?int
dim?ArrTemp1()?as?string
for?i=0?to?ubound(ArrTemp)
ArrTemp1=split(ArrTemp(i),":")
msgbox?left(ArrTemp1(1),len(ArrTemp1(1))-1)
next
VB內(nèi)部采用Unicode編碼,在這種編碼格式下,任何字符(包括半角的字母、數(shù)字、符號(hào)以及全角的漢字、符號(hào))都是占用兩個(gè)字節(jié)的。因此,Len("1111徐")的返回值是5,表示5個(gè)字符,而LenB("1111徐")的返回值是10,表示占用10個(gè)字節(jié)。
要想按ANSI編碼格式來獲取字符串的字節(jié)數(shù),必須這樣:
LenB(StrConv("1111徐", vbFromUnicode))
要注意哦,雖然返回值是6,但這個(gè)數(shù)與這個(gè)字符串在內(nèi)存中的實(shí)際占用字節(jié)數(shù)是不相符的哦!
Imports System.Text.RegularExpressions
'------
Dim text As String = "C:\Users\Administratorping 10.0.0.172 -n 1 Pinging 10.0.0.172 with 32 bytes of data: Reply from 10.0.0.172: bytes=32 time=122ms TTL=64 Ping statistics for 10.0.0.172: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 1ms, Average = 1ms C:\Users\Administrator"
Dim re As New Regex("(?=time=)\d+(?=ms)")
Debug.WriteLine(re.Match(text))
當(dāng)前文章:vb.net截取漢字,vbnet截取指定的字符串
URL地址:http://chinadenli.net/article16/hesdgg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)公司、網(wǎng)站收錄、小程序開發(fā)、面包屑導(dǎo)航、全網(wǎng)營(yíng)銷推廣、云服務(wù)器
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)