我有一個很長的字符串。我需要擺脫數有如何擺脫字符串中的數字?
And we're never gonna
bust out of our cocoons
65
00:03:04,113 --> 00:03:06,815
- if we don't put our busts out there.
- Nice metaphor.
66
00:03:06,833 --> 00:03:09,418
And we can just go to
the piano bar and not sing
............
我需要它是
And we're never gonna
bust out of our cocoons
- if we don't put our busts out there.
- Nice metaphor.
And we can just go to
the piano bar and not sing
我嘗試以下
myString = myString.replaceAll("\d+\n\d","");
使用字符類。方括號 –
你應該清楚你的要求。你說你想擺脫數字,那麼爲什麼': - >'等也被刪除?什麼是你想要的實際規則?刪除一些東西,如果它以數字開始和結束?如果不包含字母表,則刪除該行?或者只有按照確切的格式才能刪除它? –