Hello all,

I recently ran into a situation where I would like to obtain a
substring from the beginning until the first encounter with another
substring. This promoted me to write a simple function, called until
and I wondered if it would be something to add with the other string
extras for ES.next.

It could be defined as acting the same way as the following code:

String.prototype.until = function (needle) {
  return this.substr(0, this.indexOf(needle));
}

-- 
Adam Shannon
Web Developer
University of Northern Iowa
Sophomore -- Computer Science B.S. & Mathematics
http://ashannon.us
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to