Am 19.09.2025 um 17:52 schrieb Cottrell, Allin:
On Fri, Sep 19, 2025 at 4:59 AM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
> About the whitespace: OK, good to know where it comes from, but the question is
whether we want to have this behavior at the hansl level. AFAIK, in hansl the format code
%s stands for an arbitrary string, including whitespace. At least it doesn't seem to
be documented.
IMO it's best to stick with the C behavior for sscanf. Apart from
anything else, changing it would be backward-incompatible.
OK, no problem. I guess
we agree it should be mentioned in the help,
though.
Below, a few ways of getting what you originally wanted:
<hansl>
string hey = "aha oho, uhu"
string s1
sscanf(hey, "aha %31[^\n]", s1) # scan up to newline, if present
In principle I like this one especially, but the incoming string in my
case came from getinfo(<someseries>).description, and so I guess there
really wasn't any newline in there. (But my other usage of strsub was
also fully acceptable at least in my real-world case.)
thanks
sven