title: Javascript replace occurence of ID from string
body: <p>In Javascript I am trying to:</p>
  
  <p>remove ID of 5dc422e9 from lib-One-5dc422e9, </p>
  
  <p>remove ID of 5dc422e9gfg from lib-Six-5dc422e9gfg and so on. </p>
  
  <p>I want to retain everything in JSON string, just want to remove the ID part at end of <code>lib-*-</code></p>
  
  <pre><code>{
     "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
                    }
                 }
              }
           }
        }
     }
  }
  </code></pre>