WASHINGTON — President Trump, whose evolving and sometimes equivocal assessments of moral responsibility for the deadly violence in Charlottesville, Va., have won him little but criticism, fundamentally altered his approach Monday night during a prime-time address on Afghanistan.

This time, he made no mention of Charlottesville, neo-Nazis or counterprotesters. Nor did the president, as he had in previous remarks, attempt to diagnose what divides the country.

Instead, he sounded a lot like the men and women he was addressing: the nation’s military, including its senior admirals and generals.

The top officers of the Navy, the Marines, the Army, the Air Force and the National Guard had come out one by one after the violence in Charlottesville to say that racism, hatred and extremism had no place in the military, and ran counter to its most important values. Though they did not refer specifically to the commander in chief, the sharp contrast with some of Mr. Trump’s comments was as clear as it was unusual.