diff 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
line wrap: on
line diff
--- a/lib/js/urweb.js	Sat May 30 14:44:29 2009 -0400
+++ b/lib/js/urweb.js	Sun May 31 12:41:34 2009 -0400
@@ -360,6 +360,13 @@
   else
     return r;
 }
+function sspn(s, chs) {
+  for (var i = 0; i < s.length; ++i)
+    if (chs.indexOf(s[i]) != -1)
+      return i;
+
+  return null;
+}
 function schr(s, ch) {
   var r = s.indexOf(ch);
   if (r == -1)