All pastes #136282 Raw Edit

runeh

public text v1 · immutable
#136282 ·published 2006-08-17 16:02 UTC
rendered paste body
String.prototype.startswith = function(s, from , to) {
  from = from || 0;
  to = to || 9999999; // Number.MAX_VALUE seems to bug with string.slice()
  s = typeof s == "string" ? [s] : s;
  for ( var n=0; n<s.length; n++) {
    e = s[n];
    if (e=='' || this.slice(from, to).indexOf(e) == 0) return true;
  }
  return false;
}

function startsWith(h, n, from, to) {
    return h.startswith(n,from,to);
}