vb獲取字串中字元,vb獲取字串中字元

2022-05-19 14:04:13 字數 737 閱讀 5548

1樓:

private sub command1_click()dim b as integer, a as string, i as integer, c as string, d as string

a = text1.text

c = "": d = ""

for i = 1 to len(a)

b = asc(mid(a, i, 1))if (b >= 65 and b <= 90) or (b >= 97 and b <= 122) then

d = d & mid(a, i, 1)

else

if d <> "" then c = c & d & vbcrlfd = ""

end if

next i

print c

end sub

2樓:匿名使用者

private sub command1_click()dim a() as string

a = split(text1.text)for i = 0 to ubound(a)print a(i)

next

end sub

3樓:

如果每個單詞用一個空格" " 隔開你可以這樣

dim a() as string '定義存放單詞的陣列

a=split(trim(text1.text)," ")

vb提取字串問題,急,VB中如何提取字串中的部分數字

你弄的太複雜了,看懂它比較累,看看下面 比較精簡了。const kout public function takeword str as string,n as long as string dim p1 as long p1 0dim p2 as long dim count as long do...

javasplit根據換行符號擷取字串為陣列

classmain staticpublic voidmain string str strings 1234567 n890 n110a string array s split t n for int i 0 i main class 字串主要用於程式設計,概念說明 函式解釋 用法詳述見正文,這...

jquery怎麼擷取字串,怎麼從json字串中擷取字串

您好!jquery是js的一種框架,可以用js的substring方法實現你的功能!function substr 希望對您有幫助!jquery只是js的一種框架,像擷取字串,當然直接用js的方法就行了呀 js自帶的就很好用了 substr substring start,end 怎麼從json字串...