summaryrefslogtreecommitdiffstats
path: root/otherlibs/num/string_misc.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1995-11-06 10:34:19 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1995-11-06 10:34:19 +0000
commit36381cc4d98ce6c63e148ca63b44bcee0fa508ff (patch)
tree26f46fcc0f35df534d5109288e593ead14913684 /otherlibs/num/string_misc.ml
parent9b509431e4456edf7391bac5c492423be46be9ad (diff)
Portage de libnum pour Caml Special Light
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@400 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/num/string_misc.ml')
-rw-r--r--otherlibs/num/string_misc.ml18
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)
+;;