PageRenderTime 20ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/lessons/goodies.ml

http://github.com/cago/tryocaml
OCaml | 9 lines | 9 code | 0 blank | 0 comment | 2 complexity | 00b40fedfd73813b3bf993db754d7637 MD5 | raw file
Possible License(s): GPL-2.0
1let find_in good_input input =
2  try
3    let len = String.length good_input in
4    for i = 0 to String.length input - len  do
5      if String.sub input i len = good_input then
6        raise Exit
7    done;
8    false
9  with Exit -> true