Capitalize strings using titlecase

Capitalize the first letter of each word in a string or cell array of strings
ダウンロード: 544
更新 2013/9/23

ライセンスの表示

This function capitalizes each word in a string, or in a cell array of strings, excepting a user-definable set of short words. The default non-capitalized words are 'a', 'an', 'and', 'or', 'the', and 'in'.

Example:

>> C={'a walk in the park' 'two birds with one stone' 'pay the piper'}';
>> capitalize(C)

ans =

'A Walk in the Park'
'Two Birds With One Stone'
'Pay the Piper'

>> capitalize(C,{'with','THE'})

ans =

'A Walk In the Park'
'Two Birds with One Stone'
'Pay the Piper'

>>

引用

Brandon Kuczenski (2026). Capitalize strings using titlecase (https://jp.mathworks.com/matlabcentral/fileexchange/43399-capitalize-strings-using-titlecase), MATLAB Central File Exchange. 取得日: .

MATLAB リリースの互換性
作成: R2011b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCharacters and Strings についてさらに検索
タグ タグを追加
バージョン 公開済み リリース ノート
1.1.0.0

Corrected silly error that caused the function to fail for single-word inputs.

1.0.0.0