Or, instead of getting overly complicated, you could use strstr:
char *strstr( const char *string, const char *strCharSet );
Example from help files:
Then just copy the string from before the located word, strcat "me" instead of "you", then strcat the remainder of the string.
char str = "lazy";
char string = "The quick brown dog jumps over the lazy fox";
char fmt1 = " 1 2 3 4 5";
char fmt2 = "12345678901234567890123456789012345678901234567890";
void main( void )
printf( "String to be searched:\n\t%s\n", string );
printf( "\t%s\n\t%s\n\n", fmt1, fmt2 );
pdest = strstr( string, str );
result = pdest - string + 1;
if( pdest != NULL )
printf( "%s found at position %d\n\n", str, result );
printf( "%s not found\n", str );
Loop up: strstr, strncpy, strncat.
strncpy and strncat will copy/append n bytes of your string, which is what you'll need to be doing.