How to select a character array if it has a specific end value

say this is my input:
emails = 'myemail@gmail.com, random@yahoo.com, notanemail'
I would only want to select the values that contain @gmail or @yahoo (etc.) so not the last one becasue it's not an email. How could i do this?

 채택된 답변

Steven Lord
Steven Lord 2022년 2월 24일

1 개 추천

See the split and contains functions.

추가 답변 (0개)

제품

릴리스

R2021a

태그

질문:

2022년 2월 24일

편집:

2022년 2월 24일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by