//since jdk1.4   String Tmp = "<10><11><20><36>";
    String[] b = Tmp.substring(1, Tmp.length() - 1).split("><");
    for (int i = 0; i < b.length; i++) {
      System.out.println("" + b[i]);
    }

解决方案 »

  1.   

    简单写了一个,用正则表达式实现(要求JDK1.4以上):
    import java.util.regex.*;
    public class TTest {
         public static void main(String[] args) {
           String str = "<10><11><20><36>";
             Pattern pattern = Pattern.compile("<(-?[\\d]*)>");
             Matcher matcher = pattern.matcher(str);
                   while (matcher.find()){
                     String key=matcher.group(1);
                     System.out.println(key);
                   }
           }
    }
      

  2.   

    If you resort to Regeualar expressions,  nc201(Bricklayer) gave a good example,and it will be better if the pattern <(-?[\\d]*)>
     is <((\\+|-)?[\\d]+)>
      

  3.   

    不过,二楼的朋友,为什么要在
    System.out.println("" + b[i]);
    里面加""呢?不加也可以显示啊?