MATLAB ヘルプ センター
Stateflow チャートで string の末尾が部分文字列であるかの判別
R2021b 以降
tf = endsWith(str,substr)
tf = endsWith(str,substr,IgnoreCase=true)
tf = endsWith(str,substr) は、string str の末尾が部分文字列 substr である場合は 1 (true) を返し、それ以外の場合は 0 (false) を返します。
tf
str
substr
1
true
0
false
例
tf = endsWith(str,substr,IgnoreCase=true) は、大文字小文字の違いを無視して、str の末尾が substr であるかどうかをチェックします。
メモ
endsWith 演算子は、C をアクション言語として使用する Stateflow® チャートではサポートされません。
endsWith
すべて展開する
string "Hello, world!" の末尾が部分文字列 "World!" ではないため、値 0 (false) を返します。
"Hello, world!"
"World!"
str = "Hello, world!"; substr = "World!"; x = endsWith(str,substr);
大文字小文字を区別しない場合、string "Hello, world!" の末尾が部分文字列 "World!" であるため、値 1 (true) を返します。
str = "Hello, world!"; substr = "World!"; x = endsWith(str,substr,IgnoreCase=true);
入力 string。string スカラーとして指定します。リテラル文字列は二重引用符で囲みます。
例: "Hello"
"Hello"
部分文字列。string スカラーとして指定します。リテラル文字列は二重引用符で囲みます。
この演算子は Stateflow の構造体フィールドまたはメッセージの使用をサポートしません。Stateflow での構造体の詳細については、バス信号へのアクセスを参照してください。
R2021b で導入
contains | startsWith | strfind
contains
startsWith
strfind
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
ヨーロッパ
アジア太平洋地域
最寄りの営業オフィスへのお問い合わせ