Except as hereinafter provided, legal settlement in a county within the meaning of this article shall be continuous residence in such county for a period of not less than five years immediately preceding the date of application for admission or commitment, excluding the time, if any, spent by the patient in any charitable, or correctional institution or public hospital. An alien who has taken up his residence in any county in this State immediately upon arriving in this country, having had such county as his destination, and who shall have resided in such county for a period of at least three years immediately preceding the date of application for admission or commitment, shall be deemed to have a legal settlement in such county.
N.J.S. § 30:4-49