"<BODY>
<SYNC Start=2193>
The One With The Cat
<SYNC Start=6155>
Wow! That ripped!".replaceAll("<.*>","");全部搞定,关键是replaceAll用了Pattern

解决方案 »

  1.   

    String newString="<BODY>
    <SYNC Start=2193>
    The One With The Cat
    <SYNC Start=6155>
    Wow! That ripped!".replaceAll("<.*>","");
      

  2.   

    我已经把文件读取了,如何把删除命令加入到里面去呢,还请指教,我试了好几次都不行
    package ReadFileP01;       //zThis is package nameimport java.util.*;
    import java.io.*;
    /**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2004</p>
     * <p>Company: </p>
     * @author not attributable
     * @version 1.0
     */public class ReadFileC01 {
      // This is construction function(gou zao han shu)
      public ReadFileC01() {
      }  public static void main(String args[]){
        ReadFileC01 test = new ReadFileC01();
        String strfile = ".\\data\\from.txt";
        Vector vctValue = new Vector() ;
        vctValue = test.ReadFile(strfile) ;
        System.out.println("In File" + strfile +  " : " ) ;
      for (int i=0; i<vctValue.size() ; i++){
        System.out.println( vctValue.get(i) ) ;
      }  }  private Vector ReadFile(String strInFile) {
         Vector vctInFile = new Vector() ;
         String strLine = "" ;     //Every line in file
    int intLoop ;         //File line      try {
            BufferedReader bfrdInFile = new BufferedReader(new FileReader(strInFile));
            strLine = bfrdInFile.readLine();
            intLoop = 0 ;       while (strLine != null) {
              if ( !strLine.equals("")) {
                vctInFile.add( intLoop, strLine ) ;
                intLoop++ ;
              }          strLine = bfrdInFile.readLine();        }
            bfrdInFile.close();    //close file
          }     catch (Exception e) {
            e.printStackTrace() ;
          }
         return vctInFile;
      }}