Question: Write a C function called str_clean that takes in a string and modifies it, so that it removes all of the characters at the beginning

Write a C function called str_clean that takes in a string and modifies it, so that it removes all of the characters at the beginning and the end of the string that are not visible (i.e., whitespaces and control characters).

For example, the string " hello " will be trimmed down to the string "hello".

Additionally, write a complete C program that shows the correct functionality of this function, by trying it with the following input: " , XXXX429. ", where XXXX is a placeholder for the last 4 digits of your student ID number. Print the expected result when running your C program with the required input, both before and after calling the str_clean function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!