フィルターのクリア

How to select the first letter of every word

9 ビュー (過去 30 日間)
Krish Desai
Krish Desai 2015 年 12 月 5 日
コメント済み: Krish Desai 2015 年 12 月 10 日
I have no idea how I would go about doing this
Input: I like eating pizza Output: Ilep

採用された回答

Mohammad Abouali
Mohammad Abouali 2015 年 12 月 5 日
編集済み: Mohammad Abouali 2015 年 12 月 5 日
str='I like eating pizza';
str2=cellfun(@(c) c(1),strsplit(str))
  6 件のコメント
Krish Desai
Krish Desai 2015 年 12 月 10 日
Also how would I be able to eliminate extra spaces? For instance if the input was ' I like eating pizza'?
Krish Desai
Krish Desai 2015 年 12 月 10 日
Function strtrim to fix this problem.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by