Hey guys I was just wondering is there a c++ function that will eliminate white space from the start and end of a character array data obtained with the getline function? Thanks.
Jon182
0
Junior Poster in Training
Recommended Answers
Jump to PostNo, there's not a function in either the C or C++ library that will do that. You do it manually. First by finding the end of the string and walking back as long as the current character is whitespace, then replace the last occurance of whitespace with '\0'. Then by …
All 3 Replies
Narue
5,707
Bad Cop
Team Colleague
Jon182
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.