The verse you're likely thinking of is
Jeremiah 1:5.
It says: "Before I formed you in the womb I knew you, and before you were born I consecrated you; I appointed you a prophet to the nations." (NRSV)
Different translations may word it slightly differently, but the core message remains the same.