President Donald Trump should have done his homework on Merck Chairman and CEO Ken Frazier before spouting off on Twitter and implying Frazier and the drugmaker are behind "ripoff drug prices," CNBC's Jim Cramer said on Monday.

No matter what you think about the reason Frazier gave for leaving a key White House business advisory group, the president should get his facts right, Cramer said on "Squawk on the Street." "Mr. Frazier has not been at the forefront of raising prices for the sake of raising prices."

On Monday morning, Merck tweeted out a statement from Frazier, which read in part: "I am resigning from the President's American Manufacturing Council. … America's leaders must honor our fundamental values by clearly rejecting expressions of hatred, bigotry, and group supremacy. … As CEO of Merck and as a matter of personal conscience, I feel a responsibility to take a stand against intolerance and extremism."

FRAZIER TWEET

Not even an hour later, Trump blasted Frazier on Twitter.

Now that Ken Frazier of Merck Pharma has resigned from President's Manufacturing Council, he will have more time to LOWER RIPOFF DRUG PRICES!

Trump's response to Frazier's message came after the president's weekend comments about the deadly violence that erupted at a white nationalist rally in Charlottesville, Virginia. On Saturday, Trump said: "We condemn in the strongest possible terms this egregious display of hatred, bigotry, and violence on many sides."

Critics took issue with Trump's statement, saying that by adding "on many sides" and not specifically condemning the white nationalist groups by name, he was tacitly supporting the racist and anti-Semitic messages from the groups behind the rally.

"For those that think it's absolutely right that Trump called [Frazier] out because he called Trump out, all I can say is … do homework. Homework is key because I know companies. I know companies," Cramer said.

"In the industry, Mr. Frazier is not known as someone who has done ripoff pricing," Cramer argued. "There are some companies that have continually ripped off the American people. But Merck has not been one. If you hate him or like him for what he said, can we at least get the facts straight on Mr. Frazier."

On a personal note, Cramer said he respects Frazier for not making broad claims about Merck's cancer drug Keytruda.

"Mr. Frazier has so kept down his sales by not promising about what Keytruda does because he does not want to give people false hope," Cramer said. "Anyone who's lost anyone to cancer — I lost my mom to cancer — [that's] the last you want to hear."