MATLAB ヘルプ センター
Requirements Table ブロック内の位置の後にある部分文字列を抽出する
R2022b 以降
newStr = extractAfter(str,subStr)
newStr = extractAfter(str,pos)
newStr = extractAfter(str,subStr) は、部分文字列 subStr の最後の出現箇所の後から始まる、str の部分文字列を返します。
newStr
str
subStr
例
newStr = extractAfter(str,pos) は、文字位置 pos の後から始まる、str の部分文字列を返します。
pos
すべて展開する
Requirements Table ブロックで、string "Hello, world!" 内の部分文字列 "Hello, " の後にある文字列を返す要件を作成します。出力は "world!" です。
"Hello, world!"
"Hello, "
"world!"
y = extractAfter("Hello, world!","Hello, ")
Requirements Table ブロックで、string "Hello, world!" の 7 番目の文字の後にある部分文字列を返す要件を作成します。出力は "world!" です。
y = extractAfter("Hello, world!",7)
入力 string。string スカラーとして指定します。リテラル文字列は二重引用符で囲みます。
例: "Hello"
"Hello"
データ型: string
string
substr
部分文字列。string スカラーとして指定します。リテラル文字列は二重引用符で囲みます。
文字の位置。正の整数として指定します。
データ型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
出力 string。string スカラーとして返されます。
この演算子では Simulink.Bus オブジェクト フィールドの使用はサポートされません。
Simulink.Bus
R2022b で導入
extractBefore | insertAfter
extractBefore
insertAfter
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 のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
ヨーロッパ
アジア太平洋地域
最寄りの営業オフィスへのお問い合わせ