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