String.prototype.strRight=function(seperator) {
//stringValue
var pos=this.(seperator);
var result=this.substring(pos+1,this.length)
return result;
}
alert("xkr".strRight('k')); // will alert 'r'
function strRightBack(stringValue,seperator) {
var pos=stringValue.indexOflastIndexOf(seperator);
var result=stringValue.substring(pos+1,stringValue.length)
return result;
}
alert(strRightBack("xkr",'k')); // will alert 'r'
For strRightBack it should be lastIndexOf instead of indexOf, shouldn't it?
ReplyDeleteYes thats true. Thank you for pointing it out. I changed it
ReplyDelete