Back to project page Weather.
The source code is released under:
GNU General Public License
If you think the Android project Weather listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.imlongluo.weather.utils; //from w w w.j av a 2s . co m import java.util.StringTokenizer; /** * * @author longluo * ????????????????????? * */ public class WeaterInfoParser { /** * ?????content???????????????????????????? * ????????????: <code>????|?????,????|?????,.....</code> * @param content ?????????? * @return ??????????????????? */ public static String[][] parseCity(String content) { //??content???? if(content!=null&&content.trim().length()!=0) { StringTokenizer st=new StringTokenizer(content, ","); int count = st.countTokens(); String[][] citys = new String[count][2]; int i=0, index=0; while(st.hasMoreTokens()) { String city = st.nextToken(); index = city.indexOf('|'); citys[i][0] = city.substring(0, index); citys[i][1] = city.substring(index+1); i = i+1; } return citys; } return null; } }