- 论坛徽章:
- 0
|
请教: 用正则表达式如何取得字符串的日期和所包含的数字号码?
根本无需什么正则表达式
- /*
- * ContrlStr.java
- *
- * Created on 2004年10月21日, 上午2:37
- */
- package netbeans;
- /**
- *
- * @author jxd
- */
- public class ContrlStr
- {
- public void getStr()
- {
- String dayTemp = "DAY:08/10/2004";
- String storeTemp = "STORE:5128";
- String day = dayTemp.substring(4);
- String store = storeTemp.substring(6);
- System.out.println("日期为-->;"+day);
- System.out.println("下面一个为-->;"+store);
- }
-
- public static void main(String args[])
- {
- new ContrlStr().getStr();
- }
- /** Creates a new instance of ContrlStr */
- }
复制代码 |
|