ucfirst function is defined to change first letter of the sentence to upper case letter and remains other letter's are same as from orginal string.
|
Ucfirst() method definition
DROP FUNCTION IF EXISTS ucfirst;
DELIMITER $$
CREATE FUNCTION ucfirst(str_value VARCHAR(5000))
RETURNS VARCHAR(5000)
DETERMINISTIC
BEGIN
RETURN CONCAT(UCASE(LEFT(str_value, 1)),SUBSTRING(str_value, 2));
END
$$
|
Example
SELECT ucfirst("example");
SELECT ucfirst("NAME OF FATHER");
SELECT ucfirst("mother");
Output
Example
NAME OF FATHER
Mother
|