The string below is a reference fragment:
<title> String Segmentation </title>
<script language=javascript>
function Getmulti (OLDSTR) {
var newstr=oldstr;//field Contents
var i=0,j=0,t=1;//to determine whether there are multiple parts of the content
var foreindex;//records the position of the previous separator
var index,depchar;//records the current separator and its location
var linkstr= "";//Link mode
var astr = new Array (10);
var index1 = Newstr.indexof (",");
var index2 = Newstr.indexof (";");
var index3 = newstr.indexof ("%");
var index4 = Newstr.indexof (",");
var index5 = Newstr.indexof (";");
var index6 = Newstr.indexof ("");
function LTrim (str) {
for (var x=0; Str.charat (x) = ""; x + +);
Return str.substring (x,str.length);
}
if (index1!=-1) {
Index=index1;
Depchar= ",";
}
else if (index2!=-1) {
Index=index2;
Depchar= ";";
}
else if (index3!=-1) {
INDEX=INDEX3;
depchar= "%";
}
else if (index4!=-1) {
index=index4;
Depchar= ",";
}
else if (index5!=-1) {
INDEX=INDEX5;
Depchar= ";";
}
else if (index6!=-1) {
index=index6;
Depchar= "";
}
else{
T=0;index=-1;
Linkstr= "<a href=" to link the url ' target= ' BF ' > ' +newstr+ ' </a> ';
}
foreindex=0;
while (index!=-1) {
index = Newstr.indexof (Depchar, Foreindex);
if (index==foreindex) {foreindex=index+1;continue;}
if (index!=-1) {
Astr[j]=newstr.substring (Foreindex,index);
Astr[j]=ltrim (Astr[j]);
foreindex=index+1;
j=j+1;
}
}
Astr[j]=newstr.substring (Foreindex);
if (t==1)
{
for (i=0;i<j+1;i++)
{
linkstr=linkstr+ "<a href=" to link the url ' target= ' BF ' > ' +astr[i]+ ' </a> ';
}
}
return linkstr;
}
</script>
<body>
<script language=javascript>
var linkstring= "";
var tmpkeyword= "Programmer Software Management software development software complexity software maintenance software model software standard";
Linkstring=getmulti (Tmpkeyword);
document.write ("<font color= ' #006699 ' >" +linkstring+ ")
</script>
</body>
<ptml><pead><title> string Segmentation </title><script language=javascript>function Getmulti ( OLDSTR) {var newstr=oldstr;//field content var i=0,j=0,t=1;//to determine if there is more than one partial content Var foreindex;//record the position of the previous separator var index,depchar;// Record the current separator and its location var linkstr= "";//Link way var astr = new Array (10); var index1 = Newstr.indexof (","); var index2 = Newstr.indexof (";"); var index3 = newstr.indexof ("%"); var index4 = Newstr.indexof (","); var index5 = Newstr.indexof (";"); var index6 = Newstr.indexof (""); function LTrim (str) {for (Var x=0; Str.charat (x) = ""; x + +); Return str.substring (x,str.length); } if (index1!=-1) {index=index1; Depchar= ","; else if (index2!=-1) {index=index2; Depchar= ";";} else if (index3!=-1) {index=index3; depchar= "%"; else if (index4!=-1) {index=index4; Depchar= ","; else if (index5!=-1) {index=index5; Depchar= ";"; else if (index6!=-1) {index=index6; Depchar= "";} else{T=0;index=-1; Linkstr= "<a href=" to link the url ' target= ' BF ' > ' +newstr+ ' </a>"; } foreindex=0; while (index!=-1) {index = Newstr.indexof (Depchar, Foreindex); if (index==foreindex) {foreindex=index+1;continue;} if (index!=-1) {astr[j]=newstr.substring (foreindex,index); Astr[j]=ltrim (Astr[j]); foreindex=index+1; j=j+1; } astr[j]=newstr.substring (Foreindex); if (t==1) {for (i=0;i<j+1;i++) {linkstr=linkstr+ ' <a href= ' to link url ' target= ' BF ' > ' +astr[i]+ ' </a> '; } return linkstr;} </script></pead><body><script language=javascript> var linkstring= ""; var tmpkeyword= "Programmer Software Management software development software complexity software maintenance software model software standard"; Linkstring=getmulti (Tmpkeyword); document.write ("<font color= ' #006699 ' >" +linkstring+ ") </script></body></ptml>