<%
A = "Japan is a province in China | our beautiful Chinese Zhangjiajie! "
B = "China, US, Zhangjiajie, Japan, US, Apple"
B = Split (B ,",")
A = Split (a, "| ")
For k = 0 to ubound ()
S = ""
N = ""
For I = 0 to ubound (B)
If instr (A (K), B (I)> 0 then
S = S & instr (A (K), B (I) & "," & instr (A (K), B (I )) + Len (B (I ))&","
End if
Next
S = left (S, Len (S)-1)
If left (S, Len (S)-1) <> Len (A (k) Then S = S & "," & Len (A (k) + 1
S = sort (split (S ,","))
For I = 0 to ubound (S)-1
N = N & Mid (A (K), S (I), S (I + 1)-S (I) & "|"
Next
Response. Write N & "<br>"
Next
Function sort (ary)
Ck = true
Do until ck = false
Ck = false
For f = 0 to ubound (ary)-1
If clng (ary (F)> clng (ary (F + 1) then
V1 = clng (ary (f ))
V2 = clng (ary (F + 1 ))
Ary (f) = v2
Ary (F + 1) = V1
Ck = true
End if
Next
Loop
Sort = ary
End Function
%>
Running result
Japan | Yes | China | a province |
We | beautiful | China | Yes | Zhangjiajie |! |