February 2019
Intermediate to advanced
626 pages
15h 51m
English
The Contains, StartsWith, and EndsWith methods will each return true or false, depending on whether or not the string contains the specified string.
Contains returns true if the value is found within the subject string:
$string = 'I am the subject'
$string.Contains('the') # Returns $true
StartsWith and EndsWith return true if the subject string starts or ends with the specified value:
$string = 'abc'
$string.StartsWith('ab')
$string.EndsWith('bc')
Read now
Unlock full access