Java中的转义字符
\n 换行(\u000a)
\t 水平制表符(\u0009)
\b 空格(\u0008)
\r 回车(\u000d)
\f 换页(\u000c)
\' 单引号(\u0027)
\" 双引号(\u0022)
\\ 反斜杠(\u005c)
\ddd 三位八进制
\udddd 四位十六进制
相关文档:
在JAVA中, 在使用String.split方法分隔字符串时,但要注意有些字符不能直接用的,分隔符如果用到一些特殊字符,比如 "| "
,"*",等否则会出现问题,以前刚用时就因为这个问题而看了半天的代码。
public String[] split(String regex)
Splits this string around matches of the given regular expression.
&nbs ......
Runtime runtime = Runtime.getRuntime();// 开始调用服务端脚本
Process process = runtime.exec("encode.sh /home/tomcat6/kgedata/note_not_encode/ /home/tomcat6/kgedata/note_encode/");
int exitVal = process.waitFor();
System.out.prin ......
import java.text.Format;
import java.text.SimpleDateFormat;
File file = new File("a.txt");
long time = file.lastModified();
Date d = new Date(time);
Format simpleFormat = new SimpleDateFormat("E dd MMM yyyy hh:mm:ss a");
String dateString = simpleFormat.format(d);
System.err.println(file.getN ......
运行 bat(批处理) 文件
(不确定,我自己的简单demo是java可以执行批处理文件的)
Java 对批处理文件还不支持。刚开始一直在研究 Java 如何调用批处理文件,始终找不到解决方法。后来只好绕过批处理,考虑如何将批处理转换为exe可执行文件。然后再通过J ......