Write your own trim() or squeeze() function to remove the spaces from a string

Write your own trim() or squeeze() function to remove the spaces from a string

Algorithm

Algorithm is very simple we just Shift each character one by one  if space appear don’t shift it.

 

 

Output

Write your own trim() or squeeze() function to remove the spaces from a string

Suggested Reading

  1. Write a C program to reverse the words in a sentence in place
  2. Write a C program to reverse the string without using strrev() ?
  3. Write a C program which does wildcard pattern matching algorithm

If you like this Article, then don’t forget to Click on Social likes buttons.