Answers for "mysql function to remove multiple spaces from the string"

SQL
0

mysql function to remove multiple spaces from the string

CREATE FUNCTION clean_spaces(str VARCHAR(255)) RETURNS VARCHAR(255)
BEGIN
    while instr(str, '  ') > 0 do
        set str := replace(str, '  ', ' ');
    end while;
    return trim(str);
END
Posted by: Guest on March-25-2022

Code answers related to "mysql function to remove multiple spaces from the string"

Code answers related to "SQL"

Browse Popular Code Answers by Language