0
我需要編輯一些字符串(正是我需要刪除第一行)。還有就是我的輸入字符串:Groovy編輯字符串
UNA:+.? '
UNB+UNOA:2+422207530:9+8713381197918:14+20141212:1555+1082746344'
UNH+1+ORDERS:D:97A:UN'
BGM+220+105961-44+9'
DTM+137:20140121:102'
NAD+BY+0048003479::91'
NAD+SE+0000805406::91'
NAD+DP+0048003479::91'
CUX+2:USD+9'
PIA+1+M1PL05883LOT:BP::92'
PIA+1+927700077001:VP::91'
PRI+AAA:9:::1:PCE'
SCC+1'
QTY+21:10000:PCE'
DTM+2:11022014:102'
PIA+1+M1PL05883LOT:BP::92'
PIA+1+927700080201:VP::91'
PRI+AAA:9:::1:PCE'
SCC+1'
QTY+21:20000:PCE'
DTM+2:04022014:102'
UNS+S'
UNT++1'
UNZ+1+10596144'
預期輸出字符串(只是沒有第一行):
UNB+UNOA:2+422207530:9+8713381197918:14+20141212:1555+1082746344'
UNH+1+ORDERS:D:97A:UN'
BGM+220+105961-44+9'
DTM+137:20140121:102'
NAD+BY+0048003479::91'
NAD+SE+0000805406::91'
NAD+DP+0048003479::91'
CUX+2:USD+9'
PIA+1+M1PL05883LOT:BP::92'
PIA+1+927700077001:VP::91'
PRI+AAA:9:::1:PCE'
SCC+1'
QTY+21:10000:PCE'
DTM+2:11022014:102'
PIA+1+M1PL05883LOT:BP::92'
PIA+1+927700080201:VP::91'
PRI+AAA:9:::1:PCE'
SCC+1'
QTY+21:20000:PCE'
DTM+2:04022014:102'
UNS+S'
UNT++1'
UNZ+1+10596144'
我什麼都試過(記號化,替換等),但我不能這樣做。等待解決方案!
分裂的新行和刪除結果列表/數組的第一個元素,然後將其餘的與新行一起加入? – Jerry