「Java」文字列を置き換えるサンプルコード

Javaコード:
public static String strReplace(String deststr,String beforestr,String afterstr)
{
if(deststr == null || deststr.length()==0){
return “";
}

if(beforestr == null || beforestr.length()==0){
return deststr;
}

return deststr.replace(beforestr,afterstr);
}

Java

Posted by arkgame