removing garbage values from a given string

hai sir how to remove garbage values from a given string

I think that we need more information. Read the how to use this forum-please read sticky for some advice on how to ask a good question.

Create a ‘parser’ to detect the substrings ‘litter’, ‘waste’ etc from your source string. There are several techniques to truncate, compress or reconstruct your desired output string.

Read up on -
strstr()
strtok()
strcat()
and other string manipulation functions...

Define "garbage values".

Nice S, by the way.