diff options
Diffstat (limited to 'otherlibs/num/string_misc.ml')
-rw-r--r-- | otherlibs/num/string_misc.ml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/otherlibs/num/string_misc.ml b/otherlibs/num/string_misc.ml new file mode 100644 index 000000000..ba86407d8 --- /dev/null +++ b/otherlibs/num/string_misc.ml @@ -0,0 +1,18 @@ +(***********************************************************************) +(* *) +(* Caml Special Light *) +(* *) +(* Valerie Menissier-Morain, projet Cristal, INRIA Rocquencourt *) +(* *) +(* Copyright 1995 Institut National de Recherche en Informatique et *) +(* Automatique. Distributed only by permission. *) +(* *) +(***********************************************************************) + +(* $Id$ *) + +let rec index_char str chr pos = + if pos >= String.length str then -1 + else if String.get str pos = chr then pos + else index_char str chr (pos + 1) +;; |