Prefix test

Syntax

	$string1.stringStartsWith($string2)

$string1.stringStartsWith($string2, $case-sensitive)

Description

Checks if string1 starts with the string string2.

Parameter

Name Type Description Mandatory Default
string1 String A string for which it is checked whether it starts with string2. yes
string2 String A string for which it is checked whether it is at the beginning of string1. yes
case-sensitive Boolean Determines whether case sensitivity should also be used. no false - case sensitivity is not considered.

Return value

Type: Boolean

Whether string1 starts with string2.

Examples

Simple test

stringStartsWith("Hello world", "Hello")

Output: true

Case sensitive test 1

stringStartsWith("Hello world", "Hello", true)

Output: false

Case sensitive test 2

stringStartsWith("Hello world", "hello", true)

Output: false