真心求助,字符串解析问题!!

--ze6hbLXgtpQbZnvTC98zPbfLo3Zr_357l55nxx
Content-Disposition: form-data; name="expressDealId"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

111209511524_1
--ze6hbLXgtpQbZnvTC98zPbfLo3Zr_357l55nxx
Content-Disposition: form-data; name="expressCompanyId"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

wu023shangcheng
--ze6hbLXgtpQbZnvTC98zPbfLo3Zr_357l55nxx--
例如上述字符串,怎样能获取到
name="expressDealId" 111209511524_1
name="expressCompanyId" wu023shangcheng


撒科打诨
浏览 431回答 2
2回答

互换的青春

先用换行符把字符串分解成字符串数组,FOR循环,然后如果有name关键字就截取name的值(最好是正则表达式),然后I+3(或者判断Content-Transfer-Encoding关键字的下一个循环)取值
打开App,查看更多内容
随时随地看视频慕课网APP