John Locke said this quote

Virtue is harder to be got than knowledge of the world; and, if lost in a young man, is seldom recovered.