King Charles has formally stripped Prince Andrew of all royal titles and honours, Buckingham Palace has announced.