ストリングの最後に特定のサブストリングが指定されているかどうかを確認します。
パラメータ | 説明 |
---|---|
value | 確認するストリング。 |
subString | サブストリング。 |
戻り値 | 説明 |
---|---|
int | true の場合は 1、false の場合は 0 が設定されます。 |
この関数は大文字と小文字を区別します。
function p(stuff) {
print("<<<" + stuff + ">>>");
}
var s1 = "Now is the time.";
var s2 = ".";
if(@Ends(s1, s2) == @True()) // returns 1
p("String s1 ends with " + s2);
else
p("String s1 does not end with " + s2);
s2 = "e";
if(@Ends(s1, s2) == @True()) // returns 0
p("String s1 ends with " + s2);
else
p("String s1 does not end with " + s2);