blob: 3a519024ce52e9937d9bb89384c29a5858fea254 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
(***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
(* Valerie Menissier-Morain, projet Cristal, INRIA Rocquencourt *)
(* *)
(* Copyright 1996 Institut National de Recherche en Informatique et *)
(* en Automatique. All rights reserved. This file is distributed *)
(* under the terms of the GNU Library General Public License. *)
(* *)
(***********************************************************************)
(* $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)
;;
|