Harry also suggested to a group of teenagers at a correction centre in South Africa he would have liked to have come to an institution like theirs, where practical tasks are given to the youngsters.
The prince was visiting the Ottery Youth Centre in Cape Town, which looks after teenagers from troubled backgrounds who have been referred there by the courts.
When he was introduced to a dozen youngsters by Professor Ruben Richards, an expert in gang culture whose foundation runs a programme at the centre, they had no idea who their visitor was.
“I told you I was going to bring a friend of mine,” Prof Richards said.
But he when he asked if any of them knew who he was, he was met by a room of blank faces and a laughing Harry said: “That’s the right answer”.
Introducing himself to the group, Harry said: “My name is Prince Harry, the Queen of England’s grandson, Princess Diana’s son. I’ve come all the way from England to see you guys. I’m interested to hear all your stories.
“When I was at school I wanted to be the bad boy.”
But what was important, he said, was not to bow to peer pressure. “It’s much harder to stand up for what you believe in.”
Harry spoke to them of the importance of role models in avoiding the lure of gang culture – but even while delivering the a serious message he could not help getting in a quick dig at his brother William.
“If you’ve got an older brother that’s not into gangs, that’s a huge positive,” he said.
“Older brothers are supposedly the cool ones. I’m a younger brother but I’m much cooler than my older brother.”
Prof Richards laughed and said he would not tell Harry’s brother William. That was all right, said Harry. “He knows it!”
Earlier in the day retired Archbishop Desmond Tutu had praised Harry for his charity work in the impoverished country of Lesotho as he was presented with a major award.
Harry began his four-day tour of South Africa by sitting down to informal talks over tea with the Noble Peace prize winner and his wife in Cape Town.
The prince was in Lesotho last week opening his Sentebale charity’s landmark £2 million children’s centre for vulnerable youngsters and at the weekend played in a charity polo match in aid of his organisation.
The archbishop emeritus told the prince: “I am very touched by your commitment to Lesotho. I taught at the university there and became Bishop of Lesotho.
“It has always had a very soft spot in our hearts, just wonderful that you and the English are helping, thank you very much.”
Mr Tutu’s lifetime commitment to peace was recognised when Harry presented the retired archbishop with the Order of the Companion of Honour, an award given to leading individuals for outstanding achievements in arts, culture and religion.
Previous recipients include Sir John Major, Lucian Freud, Sir David Attenborough and Harold Pinter, but several honours are reserved each year for recipients from Commonwealth countries.
Mr Tutu, who is often described as South Africa’s moral conscience, particularly since the death of Nelson Mandela in 2013, said about the award: “We are deeply touched.”
He added: “We depend so much on other people. I have stuck out in a crowd because you are being carried on the shoulders of others. If the people had repudiated me, where would I be?
“The fact of the matter is that they came along and agreed with me when I said we wanted sanctions against the apartheid regime.
“Despite all of the efforts of the apartheid regime to alienate us, they stood by us and said ‘you are our leader’. Without them we I would be nothing. It’s as much their award as it is mine.”