Ciao a tutti o da effettuare uno split su alcuni record che come testo hatto:

testo1#testo2#testo3
testo1#testo2
testo1#testo2#testo3#testo4

cioè ho bisogno di estrarre in alcuni casi il testo1 in altri casi il testo3 o il testo4

ho realizzato questo script ma per il testo1 funziona mentre per gli altri casi mi lascia gli spazi

<% set rs=db.execute("select * from tabella order by campo1, campo2

if not rs.eof then
rs.movefirst
while not rs.eof

MyString=split(rs("campo1"),"~")

for r=ubound(mystring) to ubound(mystring)
for k = 0 to ubound(mystring)
next

'----ESTRAE IL TESTO1
if ubound(mystring)=0 then
response.write MyString(r)
end if


next %
<% rscatm.movenext
wend
end if %>


PER IL TESTO2 E GLI ALTRI CASI CAMBIO 0 CON 1 OPPURE 2 ECC.
FUNZIONA MA LASCIA DEGLI SPAZI TRA OGNI RECORD.
ESEMPIO

if ubound(mystring)=2 then
response.write MyString(r)
end if

scrive

testo2

testo2


testo2