当前位置: 技术问答>java相关
关于把<转化成<的问题帮我看一下代码!!帮帮
来源: 互联网 发布时间:2015-06-16
本文导语: 下面这代是我写的,初学写的不对,帮我看看应该怎么写? String age=myrs.getString("age"); age=age.replace(//g,">"); String mysay=myrs.getString("mysay"); mysay=mysay.replace(//g,">"); | //禁用HTML代码编码 public St...
下面这代是我写的,初学写的不对,帮我看看应该怎么写?
String age=myrs.getString("age");
age=age.replace(//g,">");
String mysay=myrs.getString("mysay");
mysay=mysay.replace(//g,">");
String age=myrs.getString("age");
age=age.replace(//g,">");
String mysay=myrs.getString("mysay");
mysay=mysay.replace(//g,">");
|
//禁用HTML代码编码
public String html(String s){
String re;
re=replace(s,"",">");
re=replace(re,"n","
");
re=replace(re," "," ");
re=replace(re,"'","'");
return re;
}
public String html(String s){
String re;
re=replace(s,"",">");
re=replace(re,"n","
");
re=replace(re," "," ");
re=replace(re,"'","'");
return re;
}
|
package walksing.string;
import java.text.*;
import java.util.*;
public class wsString
{
/***$id added by WalkSing [wcsz@mail.china.com] 2003-03-22 9:57 ***/
public String Jreplace(String S,String T,String I)
{ /*$id:walksing walksing@163.com 2002-03-12 9:57 make.
*para S --Source String will find to be replaced String,which
will be overwrite with T;
*para T --Target String which will overwrite S;
*para I --Input String from which to find;
*return String replacement Result;
*note:S,T,I can be String Type;
*ver 1.0;
*/
if (I.length()
import java.text.*;
import java.util.*;
public class wsString
{
/***$id added by WalkSing [wcsz@mail.china.com] 2003-03-22 9:57 ***/
public String Jreplace(String S,String T,String I)
{ /*$id:walksing walksing@163.com 2002-03-12 9:57 make.
*para S --Source String will find to be replaced String,which
will be overwrite with T;
*para T --Target String which will overwrite S;
*para I --Input String from which to find;
*return String replacement Result;
*note:S,T,I can be String Type;
*ver 1.0;
*/
if (I.length()