//Using substring
 
var s = 'test:string';
 
var i = s.indexOf(':');
 
Read the rest