Version française
Home     About     Download     Resources     Contact us    
Browse thread
scanf %n may return 1 too much?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michael Wohlwend <micha-1@f...>
Subject: Re: [Caml-list] scanf %n may return 1 too much?
On Wednesday 29 March 2006 11:50, Hendrik Tews wrote:
>
> How can I scan _precisely_ one space without the look ahead
> behavior that the format " " apparently has? I guessed "% ", but
> that raises an exception.

sscanf "   a" "%1[ ]%n" (fun s n -> n);;

scans only one space...

 Michael