blob: 13fb3139bd86578366489323529c276689ce239a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
(***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
(* Valerie Menissier-Morain, projet Cristal, INRIA Rocquencourt *)
(* *)
(* Copyright 1996 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)
;;
|