📄 replace.java
字号:
package test;
import java.util.*;
public class Replace
{
public Replace(){}
public String RepSTR(String resource,String from,String to){
int j=0;
int i=0;
int k=0;
String newstr="";
String temp=resource;
int tagc=from.length();
while(i<resource.length()){
if(resource.substring(i).startsWith(from)){
temp=resource.substring(j,i)+to;
newstr+=temp;
i+=tagc;
j=i;
}
else
{
i+=1;
}
}
newstr+=resource.substring(j);
return newstr;
}
public String repItem(String mm){
String re1="";
re1=RepSTR(mm,"的","之");
return re1;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -