content_image/708518.jpg content_image/708516.jpg
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’ 

This function is multibyte safe. 

• RTRIM( str ) 

Returns the string str  with trailing space characters removed. 

mysql> SELECT RTRIM(’barbar ’); -> ’barbar’ 

This function is multibyte safe. 

• SOUNDEX( str ) 

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. 

<img src='content_image/708518.jpg'>

## Important 

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’ 

<img src='content_image/708516.jpg'>

• expr1  SOUNDS LIKE expr2 

This is the same as SOUNDEX( expr1 ) = SOUNDEX( expr2 ) . 

• SPACE( N ) 

## Note 

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. 

