Use this cropping method to remove the back colon.
function TrimColon(text) { return text.toString().replace(/^(.*?):*$/, '$1'); }
Then you can call it like this:
TrimColon(a).split(":")
If you want, you can of course make the TrimColon string prototype method, allowing you to do something like this:
a.TrimColon().split(":");
If you need an explanation of the regular expression used: http://bit.ly/Ol8lsX
source share