在 Javascript 中,我试图:
从 lib-One-5dc422e9 中删除 5dc422e9 的 ID,
从 lib-Six-5dc422e9gfg 中删除 5dc422e9gfg 的 ID 等等。
我想保留 JSON 字符串中的所有内容,只想删除末尾的 ID 部分lib-*-
{
"data":{
"Library":{
"Checkout":{
"invoiceId":"12dfdf454546",
"checkoutDetail":{
"invoiceTransactionId":"5ab422e9",
"invoicePaymentDetail":{
"bookId":"lib-One-5dc422e9",
"checkoutPeriods":[
{
"startDate":"2017-04-14T19:00:00.000",
"endDate":"2017-05-19T19:00:00.000"
}
],
"invoice":{
"bookId":"lib-Six-5dc422e9gfg",
"checkObject":true
}
}
}
}
}
}
}