comparison lib/js/urweb.js @ 831:5e1a4b12c83a

strcspn and friends
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 May 2009 12:41:34 -0400
parents 20fe00fd81da
children b0a85cbefed2
comparison
equal deleted inserted replaced
830:d07980bf1444 831:5e1a4b12c83a
357 var r = s.indexOf(ch); 357 var r = s.indexOf(ch);
358 if (r == -1) 358 if (r == -1)
359 return null; 359 return null;
360 else 360 else
361 return r; 361 return r;
362 }
363 function sspn(s, chs) {
364 for (var i = 0; i < s.length; ++i)
365 if (chs.indexOf(s[i]) != -1)
366 return i;
367
368 return null;
362 } 369 }
363 function schr(s, ch) { 370 function schr(s, ch) {
364 var r = s.indexOf(ch); 371 var r = s.indexOf(ch);
365 if (r == -1) 372 if (r == -1)
366 return null; 373 return null;