String Support API

Convert string arrays to character arrays or cell arrays of character vectors.
다운로드 수: 189
업데이트 날짜: 2018/11/6

라이선스 보기

A common way to add string support to a function that already accepts character arrays as inputs is to convert input string arrays to character vectors or cell arrays of character vectors. The convertStringsToChars and convertContainedStringsToChars functions convert string arrays to character vectors or cell arrays of character vectors, while leaving other input arguments unaltered.

The convertStringsToChars function was released in R2017a, and convertContainedStringsToChars was released in R2018b. This implementation of convertStringsToChars and convertContainedStringsToChars facilitates writing functions that work across all versions of MATLAB. This includes versions that predate the release of the string data type in R2016b.

Example Usage:

a = convertStringsToChars("Luggage combination")

a =
'Luggage combination'

a = convertContainedStringsToChars({'matryoshka'; ...
4; "Russian nesting doll"; ...
["little", "matron"]})

a =

4x1 cell array

{'matryoshka' }
{[ 4]}
{'Russian nesting doll'}
{1x2 cell }

For more information about updating your code to accept strings, see https://www.mathworks.com/help/matlab/matlab_prog/update-your-code-to-accept-strings.html

인용 양식

MathWorks Programming Aids Team (2024). String Support API (https://www.mathworks.com/matlabcentral/fileexchange/69147-string-support-api), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2018b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Characters and Strings에 대해 자세히 알아보기
태그 태그 추가
도움

줌: strpad

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0