rray=split(showStr,",");
if(temp_array==null)
{
str="Please input String like: "First,Previous,Next,Last"";
return str;
}
fstr=temp_array[0];
pstr=temp_array;
nstr=temp_array;
lstr=temp_array;
}
/*
int npage;
npgae=page+1;
int ppage;
ppage=page-1;
if(npage>pageCount)
{npae=pageCount;}
if(ppgae<1)
{ppage=1;}
*/
if(page==1){
str=str+"<a href="+url+"page="+(page+1)+">"+nstr+"</a> ";
str=str+"<a href="+url+"page="+pageCount+">"+lstr+"</a> ";
}
if(page==pageCount){
str=str+"<a href="+url+"page=1>"+fstr+"</a> ";
str=str+"<a href="+url+"page="+(page-1)+">"+pstr+"</a> ";
}
if(page>1&&page<pageCount){
str=str+"<a href="+url+"page=1>"+fstr+"</a> ";
str=str+"<a href="+url+"page="+(page-1)+">"+pstr+"</a> ";
str=str+"<a href="+url+"page="+(page+1)+">"+nstr+"</a> ";
str=str+"<a href="+url+"page="+pageCount+">"+lstr+"</a> ";
}
return str;
}
public String split(String str,String strIn)
{
char temp_array;
temp_array=str.toCharArray();
int strLength=str.length();
int strInLength=strIn.length();
int strInTimes=0;
int strIndex=new int[strLength];
int i=0;
int ii=0;
while(i<=strLength-strInLength)
{
String temp_str="";
for(int j=i;j<i+strInLength;j++)
{
temp_str=temp_str+temp_array[j];
}
if(temp_str.equals(strIn))
{
strInTimes++;
strIndex[ii]=i;
i=i+strInLength;
ii++;
}
else
{
i++;
}
}
if(strInTimes<1)
{
String back_str=null;
return back_str;
}
else
{
String back_str=new String[strInTimes+1];
back_str[0]=str.substring(0,strIndex[0]);
for(int k=1;k<strInTimes;k++)
{
back_str[k]=str.substring(strIndex[k-1]+strInLength,strIndex[k]);
}
back_str[strInTimes]=str.substring(strIndex[strInTimes-1]+strInLength,str.length());
return back_str;
}
}
}