【发布时间】:2014-08-14 13:21:37
【问题描述】:
我有一个这样的字符串:
String a = "Barbara Liskov (born Barbara Jane Huberman on November 7, 1939"
+" in California) is a computer scientist.[2] She is currently the Ford"
+" Professor of Engineering in the MIT School of Engineering's electrical"
+" engineering and computer science department and an institute professor"
+" at the Massachusetts Institute of Technology.[3]";
我想用空格替换所有这些元素:[1]、[2]、[3] 等等。
我试过了:
if (a.matches("([){1}\\d(]){1}")) {
a = a.replace("");
}
但它不起作用!
【问题讨论】:
标签: java string match string-matching