-2

Possible Duplicate:
Remove a random expression from string

I have a column which contains values like this

 "000003023_AggregateStopLossLimit_W x3A 973911_2012-12-22.PDF";

I want to create a substring which doesn't have the part x3A 973911 in it.

Whic means I want something like this,

000003023_AggregateStopLossLimit_W_2012-12-22.PDF

The value x3A 973911 is not constant, so basically, in words, I want the part of string to be removed which comes after the first space and ends at the next '_'.

Any ideas ?

4

1 回答 1

1
 String phrase="000003023_AggregateStopLossLimit_W x3A 973911_2012-12-22.PDF";
 phrase.replace("x3A 973911","");

//不确定您是否必须修剪(),但我想这将回答您的问题。

于 2012-12-31T11:10:52.747 回答