I have a line like this.
HTML
var str = "samplestring=:customerid and samplestring1=:dept";
Js
var parts = str.split(':'); var answer = parts;
I want to trim substrings that start with a colon : from the main line
But it retains a meaning like this
samplestring=,customerid and samplestring1=,dept
But I want something like this.
customerid,dept
I get the main line dynamically, it can have a colon greater than 2.
I created a fiddle also a link
source share