Capitalize strings using titlecase

버전 1.1.0.0 (1.36 KB) 작성자: Brandon Kuczenski
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://kr.mathworks.com/matlabcentral/fileexchange/43399-capitalize-strings-using-titlecase), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Characters and Strings에 대해 자세히 알아보기
버전 게시됨 릴리스 정보
1.1.0.0

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

1.0.0.0