How can I remove the leading spaces from a string in C?
Answer
Logic to remove leading white space
Answer
Logic to remove leading white space
- Input string from user, store it in some variable say str.
- Declare a variable to store last index of leading white space character, say index = -1. …
- Run a loop from start till leading white space characters are found in str.