0
我有保持低於值的變量:前置在字符串蟒每一行
From: [email protected]
To: [email protected]
Date: Thu Sep 29 04:25:45 2016
Subject: IMAP Append Client FNBJL
MIME-version: 1.0
Content-type: text/plain; charset=UTF-8; format=flowed
hocks burdock steelworks propellants resource querying sitings biscuits lectureship
linearly crimea ghosting inelegant contingency resting fracas margate radiographic
befoul waterline stopover two everlastingly highranking doctrine unsmilingly massproducing
teacups litanies malachite pardon rarer glides nonbelievers humorously clonal tribunes
micrometer paralysing splenetic constitutionalists wavings thoughtfulness herbicide
rerolled ore overflows illicitly aerodynamics ably splittable ditching rouged bulldozer
replayed statistic reconfigured adventurers passionate rewarded decides oxygenated
需要與X:
預先考慮如下所示
X: From: [email protected]
X: To: [email protected]
X: Date: Thu Sep 29 04:25:45 2016
X: Subject: SSSSSSSSS FNBJL
X: MIME-version: 1.0
X: Content-type: text/plain
X:
X: hocks burdock steelworks propellants resource querying sitings biscuits lectureship
X: linearly crimea ghosting inelegant contingency resting fracas margate radiographic
X: befoul waterline stopover two everlastingly highranking doctrine unsmilingly massproducing
X: teacups litanies malachite pardon rarer glides nonbelievers humorously clonal tribunes
X: micrometer paralysing splenetic constitutionalists wavings thoughtfulness herbicide
X: rerolled ore overflows illicitly aerodynamics ably splittable ditching rouged bulldozer
X: replayed statistic reconfigured adventurers passionate rewarded decides oxygenated
我在上述字符串中的每個線正在考慮拆分\n
上面的字符串,並在每行前加上X:
有沒有更好的方法呢?
' 「X:」 + var.replace( 「\ n」, 「\ NX:」)' –
你可以使用正則表達式替換''^''''X:'' – allo
@VincentSavard,看起來沒問題。 – blackpen