William Shatner opens up about the ending of his friendship with “Star Trek” co-star Leonard Nimoy in his new memoir, “Live Long and… What I Learned Along the Way”.

Shatner, 87, who once considered Nimoy a best friend, explains, according to the New York Daily News: “Until the day I die, I will still wonder what caused that rift.

“After all the years we had spent together, after the bond we had forged, what could I have done that was so irreparable that he couldn’t even talk to me about it?”

Shatner even stayed away from the Spock-playing actor’s funeral after claiming he felt unwanted. Nimoy died on February 27, 2015, aged 83.

In an interview with Parade, Shatner, who played Captain James T. Kirk in the “Star Trek” TV series from 1966 to 1969, as well as appearing in seven of the movies, also discusses having a false cancer scare in 2016.

RELATED: ‘Star Trek 4’ Negotiations With Chris Pine And Chris Hemsworth Break Down Over Money

The actor tells the publication, “I want readers to know how quickly life is over and how important it is to live every moment.

“Living every moment of your life entails finding joy in what you do. It’s that joy that makes you current, relevant and alive.”

RELATED: Report — ‘Star Trek’ Actress Nichelle Nichols Is Suffering From Dementia

He adds of his new biography: “The hardest chapter was the last chapter where I talk about dying. Contemplating your own death is not easy.

“Regret is perhaps the worst emotion we humans can feel. There’s nothing to do be done about regrets. Express your regrets by future action.”