Rob Lowe says 'St. Elmo's Fire' co-star Demi Moore was 'huge inspiration' to get sober

The actor has been sober for 29 years.

Actor Rob Lowe opened up about his sobriety and how his former co-star Demi Moore inspired him to get clean during an appearance on "The View" on Monday.

"[Demi Moore] was the first person I ever knew who got sober. She was a huge inspiration to me. It was the 80s. We were all doing our thing," Lowe said on Monday. "I just remember thinking, 'Whoa. If that girl can get sober, anybody can. Everybody has that person in their life where they go, 'Oh, that's a great example.'"

Lowe, 55, appeared on "The View" to promote the new series "911: Lone Star," in which he plays a role, and his new live stage show "Stories I Only Tell My Friends." But the 1980s heartthrob also spoke about his former "St. Elmo's Fire" co-star, Demi Moore, whose bombshell memoir "Inside Out," which details devastating crossroads from her past, dropped last week.

Both Lowe and Moore were considered core members of the 1980s Brat Pack and they both struggled with addiction.

Lowe has been sober for 29 years after entering into rehab. He told "The View" co-hosts that he "loved rehab" because he learned how to better navigate life's obstacles.

"It was like going to school to learn how to live your life with tools that nobody ever taught me," Lowe said. "Here's a great one I learned: Never compare your insides to someone else's outsides. I spent a lot of time always thinking, 'Should I be doing this? That person is doing that.' ... It changed my life. I have great empathy for people who can do it themselves. I needed experts."

In an exclusive interview with Diane Sawyer last week, Moore talked about relapsing after 20 years of sobriety. Seven years ago, she had a seizure during a birthday party after using synthetic marijuana and inhaling nitrous oxide.

"My daughter [was] terrified that she was gonna see me die right in front of her," Moore told Sawyer. "Within me, I was in a place that I was thinking, 'Wow, how did I get in here? Isn't this interesting.' And then my very next thought was, 'Oh, I wonder if I can get out,' and all of a sudden I was back in my body. I think it was a moment that I...was somehow being given a choice."

Moore told Sawyer that she hopes that sharing her own stories in her memoir will help "elevate or open someone else to loving themselves a little bit better."

Every episode of ABC's award-winning talk show "The View" is now available as a podcast! Listen and subscribe for free on Apple Podcasts, Google Podcasts, TuneIn, Spotify, Stitcher or the ABC News app.