Re: stripping newline from input
From: John Smith (soneone_at_microsoft.com)
Date: 08/31/04
- Next message: John Smith: "Re: stripping newline from input"
- Previous message: John Smith: "Re: stripping newline from input"
- In reply to: Ravi Uday: "Re: stripping newline from input"
- Next in thread: John Smith: "Re: stripping newline from input"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 31 Aug 2004 13:11:44 +0100
"Ravi Uday" <raviuday@gmail.com> wrote in message
news:1093953853.274269@sj-nntpcache-5...
>
> "John Smith" <soneone@microsoft.com> wrote in message
> news:ch1oe6$jfd$1@newstree.wise.edt.ericsson.se...
> > Hi all
> >
> > Why doesn't this seem to work?
> >
> > void stripnl(char *sz)
> > {
> > char *nl;
> > nl = strchr(sz, '\n');
> > if (nl)
> > {
> > *nl = '\0';
> > }
> > }
> >
> > The string fed in still has the newline after calling this function.
>
> How do you know that ? There might be a '\r' (CR- if file is taken from
> windows) otherwise the function is fine.
>
>
>
> >
> > Thanks
> > John
> >
> >
>
>
Hey, that might be it! I'll remove '\r' also.
Thanks for the help
John
- Next message: John Smith: "Re: stripping newline from input"
- Previous message: John Smith: "Re: stripping newline from input"
- In reply to: Ravi Uday: "Re: stripping newline from input"
- Next in thread: John Smith: "Re: stripping newline from input"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|