StartsWith
Tests whether a string begins with a specified prefix using case-sensitive comparison.
Syntax
StartsWith(source, prefix)
Parameters
- source (string): The source string to test
- prefix (string): The prefix to search for
Returns
- boolean: True if the source string begins with the prefix
Description
Performs case-sensitive comparison using ordinal string comparison semantics for consistent behavior.
Examples
var result1 = StartsWith("Hello World", "Hello") # Returns true
var result2 = StartsWith("filename.txt", "file") # Returns true
var result3 = StartsWith("Hello", "hello") # Returns false (case-sensitive)
var result4 = StartsWith("test", "testing") # Returns false