String Functions and Operators This function is multibyte safe. • RPAD( str , len , padstr ) Returns the string  str , right-padded with the string  padstr  to a length of  len  characters. If  str  is longer than  len , the return value is shortened to  len  characters. mysql>  SELECT RPAD(’hi’,5,’?’); -> ’hi???’ mysql>  SELECT RPAD(’hi’,1,’?’); -> ’h’ mysql>  SELECT RTRIM(’barbar ’); -> ’barbar’ This function is multibyte safe. Returns the string  str  with trailing space characters removed. • RTRIM( str ) • SOUNDEX( str ) This function is multibyte safe. Returns a soundex string from  str . Two strings that sound almost the same should have identical soundex strings. A standard soundex string is four characters long, but the  SOUNDEX()  function returns an arbitrarily long string. You can use  SUBSTRING()  on the result to get a standard soundex string. All nonalphabetic characters in  str  are ignored. All international alphabetic characters outside the A-Z range are treated as vowels. When using  SOUNDEX() , you should be aware of the following limitations: •This function, as currently implemented, is intended to work well with strings that are in the English language only. Strings in other languages may not produce reliable results. •This function is not guaranteed to provide consistent results with strings that use multibyte character sets, including  utf-8 . See Bug #22638 for more information. mysql>  SELECT SOUNDEX(’Hello’); -> ’H400’ mysql>  SELECT SOUNDEX(’Quadratically’); -> ’Q36324’ This function implements the original Soundex algorithm, not the more popular enhanced version (also described by D. Knuth). The difference is that original version discards vowels first and duplicates second, whereas the enhanced version discards duplicates first and vowels second. This is the same as  SOUNDEX( expr1 ) = SOUNDEX( expr2 ) . • expr1  SOUNDS LIKE  expr2 • SPACE( N ) Important Note 2181