Someone
public c v1 · immutableshort foundword= 0, eraseamount= -1; /* doesn't work in situation in which there are whitespaces after word Example: bar foo___(ctrl-backspace here)Result should be bar_but is bar foo____ is whitespace*/ for(x=but->pos; x>=0; x--) { if(str[x] != ' ' && foundword == 0) /* there are other possibilities also? */ foundword= 1; if(str[x] == ' ' && foundword == 1) break; eraseamount++;}