📄 teststring.java
字号:
package net.aetherial.gis.output.toLd.test;
import java.util.StringTokenizer;
import java.io.File;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class TestString {
public TestString() {
}
private void tes(int i) throws Exception{
if (i == 0) {
throw new Exception("0错误,i == " + i);
}else{
throw new Exception("i == " + i);
}
}
private void can() throws Exception{
this.tes(1);
}
private String getleft(String rex,String replacement) throws Exception{
if (rex.indexOf(replacement) == -1) {
throw new Exception("字符不匹配!");
}else{
return rex.substring(replacement.length(),rex.length());
}
}
public static void main(String[] args) {
// TestString ts = new TestString();
// String n1 = "E:\\农村公路通达情况调查\\数据\\报部数据\\安徽省\\安庆市\\枞阳县\\整理完毕\\乡\\Y005.gps";
// String n2 = "E:\\农村公路通达情况调查\\数据\\报部数据\\安徽省\\安庆市\\枞阳县\\";
//
// String n3 = "E:\\temp\\枞阳县\\temp\\";
// try {
// System.out.println(n3 + ts.getleft(n1, n2));
// }
// catch (Exception ex) {
// System.out.println(ex.getMessage());
// }
// System.out.println(n1.replaceAll(n2,n3));
// String lDNumber = "Y998||238";
// StringTokenizer st = new StringTokenizer(lDNumber, "||");
// st.nextToken();
// st.nextToken();
//
// System.out.println(st.countTokens());
// TestString ts = new TestString();
// try {
// ts.can();
// }
// catch (Exception ex) {
// ex.printStackTrace();
// }
// String xiangzhen = "麒麟.gps";
// String xiandao = "x002.gps";
// System.out.println(xiangzhen.toUpperCase().endsWith(".GPS"));
// System.out.println(xiangzhen.toUpperCase().endsWith(".cPS"));
// System.out.println(xiandao.toUpperCase().startsWith("X"));
// System.out.println(xiandao.toUpperCase().startsWith("x"));
// File newFile = new File("D:\\数据备份\\报部数据\\安徽省\\安庆市\\枞阳县\\部接口");
// System.out.println(newFile.getParentFile().getAbsolutePath()+"\\信息表\\");
double t = Double.parseDouble("50");
System.out.println(t);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -