Mr Trump tweeted after the subject of Markle came up in an interview he gave the British newspaper The Sun ahead of his three-day state visit to the United Kingdom this week.
The Sun has now posted an audio recording of the interview with its political editor on its website.
The US leader told the tabloid he was not aware that Markle, a former actress who married Prince Harry in May 2018, supported his Democratic rival Hillary Clinton in the 2016 presidential election and had vowed to move to Canada if he won the White House.
During the 2016 campaign, Markle said Mr Trump was "misogynistic" and "divisive".
"You're not just voting for a woman if it's Hillary. Yes, you're voting because she's a woman, but certainly, because Trump has made it easy to see that you don't really want that kind of world that he's painting," Markle said.
Mr Trump told The Sun he was not aware of the comments the former actress had made about him.
"I didn't know that. What can I say? I didn't know that she was nasty," the president said.
The president, however, said he thought Markle would make "a very good" American princess.
"It is nice, and I am sure she will do excellently. She will be very good. I hope she does (succeed)," Mr Trump said, referring to Markle's role as a member of the British royal family.
During his state visit, Mr Trump will be welcomed with full honours and is scheduled to meet with several members of the royal family.
The Duchess of Sussex, however, will not participate in the events because she gave birth a few weeks ago to her first child, Archie.