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