I was learning how to use "Strip" command and started with the example code included:
- Code: Select all
//Strip.c
//Example using Strip on spaces
library "PToolboxLib"
main() {
string str = " this is a test ";
string tmp;
tmp=str; //copy str into tmp;
puts(tmp+":End\n");
Strip(&tmp," ",0x0111); //strip out all whitespace from front & back, and skip middle of string.
puts(tmp+":End\n");
tmp=str;
Strip(&tmp," ",0x1011); //strip out all whitespace from front & back, and make words separated only by 1 whitespace
puts(tmp+":End\n");
}
This is the output that I got:
- Code: Select all
<i>NOTE: quotes were added for this output only</i>
" this is a test :End"
":End"
":End"
Shouldn't the spaces rather then the text be missing? I didn't change the example at all. I am using PToolBox 7.6.1 and PocketC 6.5.1. I understand that the command 0x0011 should also remove ALL the spaces in the string ("thisisatest:End"), right?
Thanks for your help!
-Michael Dansie