How to stop autocorrect from putting a space after it corrects a word

Solution 1:

If the autocorrect word is highlighted, then you can also accept it by just tapping Space. If you double-tap Space, it will accept and insert the stop, same as a regular word.

enter image description here enter image description here

After question edits: this also works if you type any punctuation, bracket, question mark etc.