📄 testclone.java
字号:
package com.cloudwebsoft.framework.test;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class TestClone implements Cloneable {
public Integer i;
public Long l;
public String s;
public Double d;
public Object o;
public TestClone() {
i = new Integer(10);
l = new Long(11);
s = "12";
d = new Double(5.0);
o = new Integer(6);
}
public Object clone() {
try {
return super.clone();
}
catch (Exception e) {
}
return null;
}
public static void main(String[] args) {
TestClone tc = new TestClone();
TestClone tc2 = (TestClone)tc.clone();
System.out.println(tc);
System.out.println(tc2);
System.out.println(tc.i + " " + tc.l + " " + tc.s + " " + tc.d + " o=" + tc.o);
System.out.println(tc2.i + " " + tc2.l + " " + tc2.s + " " + tc2.d + " o=" + tc2.o);
String str = "[face=楷体GB2312]dddd[face=宋体123]ffff[/face]ddd[/face]asdasdf[face=333]333[/face]";
String patternStr = "\\[face=(.[^\\[]*)\\](.[^\\[]*)\\[\\/face\\]";
Pattern pattern = Pattern.compile(patternStr, Pattern.DOTALL);
Matcher matcher = pattern.matcher(str);
String content = matcher.replaceAll("<font face=$1>$2</font>");
System.out.println(content);
matcher = pattern.matcher(content);
content = matcher.replaceAll("<font face=$1>$2</font>");
System.out.println(content);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -