String manipulation in C (replace & insert characters)

I am not going to give you exact code but I will give you some links that will help you.

strchr :: You can use this find the position of ‘=’ in the string.

  1. Now, copy the string after the position of ‘=’ till you find a ‘space’.
  2. Whenever you will find a ‘space’, write a ‘#’ in the buffer.
  3. Keep doing this, till you encounter a ‘\0’. Write ‘##’ to buffer when you have encountered ‘\0’
  4. Append that with a ‘\0’.

Ex:: C function strchr – How to calculate the position of the character?

Leave a Comment