Question: Write a function (in C Program) char *delete SubSt ring (char *source, char *substring) that takes two strings called source and substring as its parameters.
Write a function (in C Program) char *delete SubSt ring (char *source, char *substring) that takes two strings called source and substring as its parameters. It should return a new dynamically allocated string that is constructed from the strings source and substring. The newly created and returned string should be the same as the source string, but with the first occurrence of the string, substring removed. For example, if the string source has the value "my Toronto", and the string substring has the value "to", the function will return the string "my ronto".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
