Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] [repost] Request for more String functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dustin Sallings <dustin@s...>
Subject: Re: [Caml-list] [repost] Request for more String functions

On Feb 20, 2004, at 9:28, Richard Jones wrote:

> Another difficulty I find is doing search and replace on strings, in
> simple cases where the overhead of a regular expression probably isn't
> warranted.  For example, escaping all '<' characters in a string with
> '&lt;'.  It would be nice to have a Search.char_replace function to do
> this.

	I ran into problems with just plain search first.  My programs are 4x 
faster with plain splits and searches than regex.  Here's some of the 
stuff I've added:

val split : string -> char -> int -> string list
val split_chars : string -> char list -> int -> string list
val strstr : string -> string -> int -> int
val ends_with : string -> string -> bool
val begins_with : string -> string -> bool
val string_of_chars : char list -> string

-- 
Dustin Sallings

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners