我有2個字符串變量,爪哇 - 斯普利特2字符串,並將其存儲在一個字符串數組
String expectedDocsTextReqA = "A1:A2:A3:A4";
String expectedDocsTextReqB = "B1:B2:B3:B4";
我想Split these 2 strings and store it in a single String array
如何做到這一點?
我試圖實現這樣的事情,但是這會引發異常。有沒有其他方法可以做到這一點?
String[] arr = expectedDocsTextReqA.split(":") + expectedDocsTextReqB.split(":");
看看:https://stackoverflow.com/questions/80476/how-can-i-concatenate-two-arrays-in-java – Dorian
'String [] arr =(expectedDocsTextReqA +「:」+ expectedDocsTextReqB) .split(「:」);'工作正常 – XtremeBaumer