Determines if a string starts with characters given by another string.
This function does not generate a change.
str.starts_with(search_string)
| Argument | Type | Description |
|---|---|---|
| search_string | str (required) | The characters to be searched for at the start of this string. |
Returns true if the given characters are found at the start of the string and otherwise false.
This code shows an example using starts_with():
'the answer to life the universe and everything'.starts_with('the answer');
Return value in JSON format
true