Re: Split string whose length is varying
- From: Christopher Benson-Manica <ataru@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 6 Oct 2005 15:49:25 +0000 (UTC)
Java and Swing <codecraig@xxxxxxxxx> wrote:
> thanks for the input, i will try to make changes as you suggested.
> what simpler ways are there to count the number of commas in msg?
It is proper Usenet etiquette to include the text you are replying to.
To do this using Google groups, please follow the instructions below,
penned by Keith Thompson:
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
(That said, assuming count is an int and cp is a char *:
count=0;
while( (cp=strchr(msg,',')) != NULL ) {
count++;
cp++;
}
is much better for counting commas.)
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
.
- Follow-Ups:
- Re: Split string whose length is varying
- From: Java and Swing
- Re: Split string whose length is varying
- References:
- Split string whose length is varying
- From: Java and Swing
- Re: Split string whose length is varying
- From: Eric Sosman
- Re: Split string whose length is varying
- From: Java and Swing
- Split string whose length is varying
- Prev by Date: Re: Split string whose length is varying
- Next by Date: Re: Split string whose length is varying
- Previous by thread: Re: Split string whose length is varying
- Next by thread: Re: Split string whose length is varying
- Index(es):
Relevant Pages
|