/** * Checks if the string starts with the provided prefix. * * @param string|Mol_DataType_String $prefix * @return boolean True if the string starts with the prefix, false otherwise. */ public function startsWith($prefix) { return Mol_Util_String::startsWith($this->value, $this->toValue($prefix)); }
/** * Ensures that startsWith() returns false if the string is shorter than the * prefix and equals the first part of the prefix. */ public function testStartsWithReturnsFalseIfStringEqualsFirstPartOfPrefix() { $result = Mol_Util_String::startsWith('test', 'testprefix'); $this->assertFalse($result); }