I have a string (ex. "one two three four"). I know that I need to cut word that starts from 4th to 6th symbol.
How can I achieve this?
Result should be:
Cut string is "two"
Result string is "one three four"
For now I achieved, that I can get the deleted word - '
for(i = 0; i < stringLength; ++i) {
if((i>=wordStart) && (i<=wordEnd))
{
deletedWord[j] = sentence[i];
deletedWord[j+1] = '\0';
j++;
}
}
but when I fill the sentence[i] = '\0' I have problems with cutting string in the middle.