Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #function #remove #multiple #spaces #string
ADD COMMENT
Topic
Name
5+4 =