How can one code a function to remove all trailing blanks from the right end of a string, assuming i use
void trimRight(char a);
From the end of the string walk backward until you find a non-blank character, then overwrite the last blank you saw with
'\0'. Easy peasy, and here's a working example of an rtrim function to get you rolling.
We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.