'str sträng med rader indelade av vbcrlf
dim a
a = split(str,vbcrlf)
dim words,firstWords()
words = ubound(a) + 1
redim firstWords(words)
dim i
for i = 0 to words
firstWords(i) = left(a(i),instr(a(i),",")-1)
next
Så här då, nu hoppar jag över de fem första och jag har även lagt till en kontroll om det finns ett komma. Om inte så lagras hela den raden som ett ord.
'str sträng med rader indelade av vbcrlf
dim a
a = split(str,vbcrlf)
dim words,firstWords()
words = ubound(a) + 1 - 5
redim firstWords(words)
dim i,pos
for i = 0 to words
pos = instr(a(i+5),",")-1)
'dubbelkoll
if pos > 0 then
firstWords(i) = left(a(i+5),pos)
else
firstWords(i) = a(i+5)
end if
next
'str sträng med rader indelade av vbcrlf
dim a
a = split(str,vbcrlf)
dim words,firstWords()
words = ubound(a) + 1 - 5
redim firstWords(words)
dim i,pos
for i = 0 to words - 1
pos = instr(a(i+5),",")-1)
'dubbelkoll
if pos > 0 then
firstWords(i) = left(a(i+5),pos)
else
firstWords(i) = a(i+5)
end if
next
'str sträng med rader indelade av vbcrlf
dim a
a = split(str,vbcrlf)
dim words,firstWords()
words = ubound(a) + 1 - 5
redim firstWords(words)
dim i,b
for i = 0 to words - 1
b = split(a(i+5),",")
if ubound(b) >= 2 then
firstWords(i) = b(2)
else
firstWords(i) = a(i+5)
end if
next
262 ms totalt · 4 externa anrop · v20260731065814-full.51f67c91