It really depends on what you want to do with the string.  If you want to
replace the funny characters with some other character, such as a space, the
following would work:

int  i = 0;

while (id[i] != '\0')
  {
  if (id[i] < ' ' || id[i] > 'z')
    id[i] = ' ';
  i++;
  }

If you wish to simply remove those characters from the string, you can do
the following:

int i=0, j=0;
char id2[MAXLEN];      // where max len is defined to the max length of the
string

while (id[i] != '\0')
  {
  if (id[i] >= ' ' && id[i] <= 'z')
    id2[j++] = id[i];
  i++;
  }




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of maria
j�nsson
Sent: Thursday, October 04, 2001 8:45 AM
To: Palm Developer Forum
Subject: Cuting strings


Hi everybody!
When I read a record from a database I get a long string with some funny
signs in it. Example:

  i[]00112578[]Jonsson Maria
(the [] illustrates a rectangle here)

If I want to get the signs 00112587 and Jonsson Maria and put them into two
variables, how do I do that?

I tried this: id[8]='\0'; But then I got: i[]001125

How do I get ride of the 2 first signs??

Thanks in advance //Maria

_________________________________________________________________
H�mta MSN Explorer kostnadsfritt p� http://explorer.msn.se


--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to