> I had done a Google search on "StrStr" and found a little example like
what
Vu Pham posted.

 Thanks for the help,
 D. Kirker

 P.S. How could I delete the character at the offset found with StrStr and
 all the characters to the end of the string?

If you search for a char, then it is better to use StrChr. If you search for a str, then use StrStr.

If pend points to the found offset, then *(pend+1) will "delete" the rest of
the string.
If you really want to clear all chars after pend, then put 0x0 to each char
since pend+1 until the end of the original str.

Except that this won't work for multi-byte characters. To handle that correctly, assuming a FindCharOffset routine that returns the offset, then you'd do something like:


        offset = FindCharOffset(buffer, someChar);
        if (offset != -1)
        {
                offset += TxtGetNextChar(buffer, offset, NULL);
                buffer[offset] = '\0';
        }

-- Ken
--
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

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

Reply via email to