开发者

how to split the data from sqlite. i need to separate data by each sentence(means split by .)

开发者 https://www.devze.com 2023-03-03 05:13 出处:网络
String subTopicsArray [] = detail.split(\"\\\\. \"); StringBuffer splitTopic开发者_StackOverflows = new StringBuffer();
    String subTopicsArray [] = detail.split("\\. ");
    StringBuffer splitTopic开发者_StackOverflows = new StringBuffer();

    for(int i=0; i<subTopicsArray.length; i++){     
        String abc=subTopicsArray[i].trim();
        if (abc.length() > 0)
        {
        splitTopics.append(i+1+") "+subTopicsArray[i].trim()+"."+"\n" );
        splitTopics.append("\n");
        }

Am using this but am getting two dots for last sentence


use StringTokenizer with deliminator "."

For Example:

StringTokenizer st  = new StringTokenizer(detail);
while(st.hasMoreTokens())
{
   st.nextToken();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消