Java正则表达式
package com.sy.grasp;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegularExpression {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
/*String [] fakeFileData ={
"justin\t64/5/26\t09323432434\t4546465",
"momor\t68/7/23\t43543653\t34535435"
};
for(String data : fakeFileData){
String[] tokens=data.split("\t");
for(String token:tokens){
System.out.print(token+"\t|");
}
System.out.println();
}
* 显示结果:
* justin |64/5/26 |09323432434 |4546465 |
momor |68/7/23 |43543653 |34535435 |
* */
/*String text="abcdebcadxbc";
String[] tokens=text.split(".bc");
for(String token:tokens){
System.out.print(token+" ");
}
System.out.println();
tokens=text.split("..cd");
for(String token:tokens){
System.out.print(token+" ");
}
System.out.println();
* 返回结果是:
* d ad
ebcadxbc
解释:使用.bc来作比对,由于符合的子字符串有abc ebc xbc 3个,所以split()方法会使用这三个字符串来做字符串分离
,返回的就是不符合表达式.bc的d和ad了,同理..cd
* */
/*BufferedReader reader=new Bu
相关文档:
private static List cloneObject(
Object obj) throws Exception {
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(byteOut);
out.writeObject(obj);
ByteArrayInputStream byt ......
try {
Runtime.getRuntime().exec("C:\\xxx.exe");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} ......
http://hi.baidu.com/0_net/blog/item/8566fc2bb730c293033bf63e.html
一.获得控制台用户输入的信息
/** *//**获得控制台用户输入的信息
* @return
* @throws IOException
*/
public St ......
2010-04-26 22:36
import java.util.Scanner;
public class _calendar {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("请输入年份:");
Scanner sc = new Scanner(System.in);
int year = sc.nextInt(); ......
今天是来传智播客的第一天,幸亏之前看过thinking in java 感觉理解不是很吃力,但是感觉挺累的
1。外挂插件的步骤:
1,在eclipse的目录下建立links目录。
2,在links目录下,建立一个文件,内容为插件eclipse目录的父目录;
path=插件eclipse目录的父目录 path=F:\\Eclipse\\NLpack1-eclipse-SDK-3.2.1-w ......