您的位置:首页 > Web前端 > JavaScript

jsp生成html--replace

2004-11-29 17:15 483 查看
package ball.news;
import java.io.*;
import news.ReadTemplates;
public class  ReplaceAll
{
 private static Object a = new Object();
 public ReplaceAll()
 { 
 }

 public String replace(String content,String flag,String temp)
 {
  String str = null;
  
        try
        {
         //System.out.println("before-----"+content);
         String s1 = content;
            str = s1.replaceAll(flag,temp); 
           // System.out.println("replace after-----"+str);
        }
        catch(Exception e)
        {
         System.out.println("replace all error:"+e.getMessage());
        }
        return str;
       
    }
    private static void a(String s)
    {
        File file = new File(s);
        if(!file.exists())
            file.mkdirs();
    }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息