startsWith
The startsWith task determines whether a string begins with another string and returns a boolean result of true or false.
Potential use case
Use this task to check the placement of a variable within a string of characters, or to determine if the string has missing or added characters.
Properties
Example 1
In this example:
- The
stris statically set to"Hello World". - The
searchStringis"W"and thepositionis6. - The
resultreturnstrue— the letter"W"is located at position six.


Example 2
This example is the same as Example 1, except the space between the words has been removed, making the string "HelloWorld".

The result returns false — removing the space shifted "W" to position five, so it is no longer at position six.
