instead of deleting remaining spaces, you need to change them to 00 (in the hex editor, instead of the ascii editor).
So, if there was ryl2.game.mmm , which is a 13 character long string and you are replacing to 127.0.0.1 (9 characters), you have 4 characters less... Now change it in the ascii editor to 127.0.0.1 and you will have this string: 127.0.0.1.mmm , then go to the hex editor, usually on the left side, and fill the 4 addresses containing .mmm with 00 and you will notice on the ascii editor that your string is now 127.0.0.1 only , and no address was deleted.