Joshua - Chapter 23

Joshua is now old and he summons the leaders for a final farewell address.  He tells them not to associate with those nations that remain in the land God has given them.  They must not intermarry with them or associate with them.

Similarly, in John 16 and 17 we see Jesus giving a farewell address to his disciples just before he is arrested and crucified.  He says that the disciples are in the world but not of the world.  He prays not that they are taken out of the world, but that they are sanctified (kept separate) within it.