Mercurial > urweb
comparison lib/js/urweb.js @ 2045:534577e429e1
Added javascript for Basis.strsindex
author | Samuel Dukhovni <dukhovni@mit.edu> |
---|---|
date | Mon, 28 Jul 2014 20:18:43 -0400 |
parents | 2b2d07946e65 |
children | 7c2229aa22fc |
comparison
equal
deleted
inserted
replaced
2044:42ae25a354f8 | 2045:534577e429e1 |
---|---|
1205 function sub(s, i) { return s.charAt(i); } | 1205 function sub(s, i) { return s.charAt(i); } |
1206 function suf(s, i) { return s.substring(i); } | 1206 function suf(s, i) { return s.substring(i); } |
1207 function slen(s) { return s.length; } | 1207 function slen(s) { return s.length; } |
1208 function sidx(s, ch) { | 1208 function sidx(s, ch) { |
1209 var r = s.indexOf(ch); | 1209 var r = s.indexOf(ch); |
1210 if (r == -1) | |
1211 return null; | |
1212 else | |
1213 return r; | |
1214 } | |
1215 function ssidx(h, n) { | |
1216 var r = h.indexOf(n); | |
1210 if (r == -1) | 1217 if (r == -1) |
1211 return null; | 1218 return null; |
1212 else | 1219 else |
1213 return r; | 1220 return r; |
1214 } | 1221 } |