So she made a vow and said, “O Lord of Hosts, if You will indeed look on the affliction of Your maidservant, and remember me and not forget Your maidservant, but will give to Your maidservant a baby boy, then I will give him to the Lord all the days of his life, and no razor shall touch his head.”
At the end of two months she returned to her father, and he did to her according to the vow that he had made. She had not ever slept with a man. So it became a custom in Israel