M
Magix
Hi,
Everytime I received a fix-length of string, let say 15 (the unused portion
will filled with Spaces before receive), I want to remove the Spaces from
END until I encounter a non-space char.
let say: testBuf is the buffer that receive this fix-length string.
printf("[%s]",testBuf);
Output:
[Hello World ]
How to remove the spaces to become [Hello World] ? Any fast and effcient C
algorithm like using strchr,etc?
Thanks.
Everytime I received a fix-length of string, let say 15 (the unused portion
will filled with Spaces before receive), I want to remove the Spaces from
END until I encounter a non-space char.
let say: testBuf is the buffer that receive this fix-length string.
printf("[%s]",testBuf);
Output:
[Hello World ]
How to remove the spaces to become [Hello World] ? Any fast and effcient C
algorithm like using strchr,etc?
Thanks.