So, I got to a point where I have a string with words and punctuation marks ( a full sentence to be exact). I wanted to change one word in that sentence. The number of letters of the new word may not be the exact with the previous one. I also have a 2-d matrix with the words of the sentence changed now so that it has the new word instead of the old one. So I managed to trade all words in my original string with a `*` and keep the punctuation marks so that I can change the `*` with the words of the altered 2-d matrix and keep the punctuation marks. So my real question is how can I change the `*` of the string with whole words and then add the punctuation marks where needed.

```
Example:
Original string: HELLO PEOPLE. HELLO WORLD. HOW ARE YOU TODAY?
Word for change: WORLD --> MAN
String with '*': * *. * *.* * * *?
Result I want: HELLO PEOPLE. HELLO MAN. HOW ARE YOU TODAY?

```

I tried this (with `text3` string with'\*' and text 4 the result I want):

```
l1=0;sum3=0;
for (k=0;k<sum2;k++){
    if (text3[k]=='*'){
        strcpy(&text4[sum3],textb1[l1]);
        l1++;
        sum3=sum3+strlen(textb1[l1]);
    }
    else {
        text4[sum3]=text3[k];
        sum3++;
    }
}
printf("%s\n",text4); 

```

But I only manage to get the first HELLO printed.