/** * Lowercase the first letter of a string * * Example:: * * String.firstLetterToLowerCase('CamelCase') == 'camelCase' * * @param string $string The input string * @return string The string with the first letter in lowercase */ public function firstLetterToLowerCase($string) { return UnicodeFunctions::lcfirst($string); }
/** * Checks if our version of lcfirst can handle some common special chars. * * @test */ public function lcfirstWorksWithCertainSpecialChars() { $testString = 'ÄEUGIAT TINCIDUNT DUO ID, 23 QUAM DELENIT VOCIBUS NAM EU'; $expectedResult = 'äEUGIAT TINCIDUNT DUO ID, 23 QUAM DELENIT VOCIBUS NAM EU'; $this->assertEquals($expectedResult, Functions::lcfirst($testString), 'lcfirst() did not return the correct string for a umlaut.'); $testString = 'ÅEUGIAT TINCIDUNT DUO ID, 23 QUAM DELENIT VOCIBUS NAM EU'; $expectedResult = 'åEUGIAT TINCIDUNT DUO ID, 23 QUAM DELENIT VOCIBUS NAM EU'; $this->assertEquals($expectedResult, Functions::lcfirst($testString), 'lcfirst() did not return the correct string for danish a.'); }