i know no builtin function but...
Hi,
ok I know no builtin function that does the whole task, but basic_string / string offers a set of functions to do this easy AND compatible. you can port this to any ANSI-C++-environment . I will describe this not with a code sample, because I'm too tired now and don't want t post something with a wrong sytax etc. :p
1. get an iterator for your string
2. iterate throgh the string characters.
3 test each character for whitespace / blank
4. if it is a space-character call the remove() function of basic_string on the iterator.
DONE !!!
the remove()-function removes the character the iterator is pointing at and collapses the following characters to really remove the character.
I hope you got the message, even though my english is terrible when I'm tired ;)
code on
Juergen