java - Parsing routine not working on Android -


i coded parsing routine time ago java console program , works fine. today tried put android project seems not work properly.

public static string[] parser(string pageout,string delim1,int offset1,string delim2,int offset2,int relieve) {     if(pageout.length()<delim1.length()){         string[] mid={"",pageout};         return mid;     }      string[] results=new string[2];     int index=pageout.indexof(delim1)+delim1.length()+offset1;     if(index==-1 | index==0){         string[] mid={"",pageout};         return mid;     }     string left=pageout.substring(index,pageout.length());     int index2=left.indexof(delim2)+offset2;     results[0]=left.substring(0,index2);     results[1]="";     if(relieve==1)         results[1]=left.substring(index2+delim2.length(),left.length());     return results; } 

may not work because got input string(pageout in routine) httprequest? got way , seems right string if displayed on screen.

        httpresponse responsereq;         responsereq = client.execute(httppost);         httpentity entity=responsereq.getentity();         response=entityutils.tostring(entity); 

someone has idea?


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -