我想分裂一个日期刺痛。以下是不工作:用正则表达式分割“。”
String test = "06.09.2015";
String[] arrDateBegin1 = test.split(".");
,但是这是工作:
String test = "06.09.2015";
String[] arrDateBegin1 = test.split("/.");
而且这样的:
String test = "06/09/2015";
String[] arrDateBegin1 = test.split("/");
为什么比斜线不同点?
可能重复的http://stackoverflow.com/questions/3387622/split-string-on-as-delimiter – Sybren
*“但这是工作:'字符串测试=”06.09.2015“;字符串[] arrDateBegin1 = test.split(“/。”);'“* [不,它不是](http://ideone.com/7JUL2N)。 –
http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split%28java.lang.String%29 – anothertest