~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/functions/string/modification.rst

  • Committer: vjsamuel1990 at gmail
  • Date: 2011-09-15 13:44:31 UTC
  • mto: This revision was merged to the branch mainline in revision 2420.
  • Revision ID: vjsamuel1990@gmail.com-20110915134431-65c6fgtz7z45umk9
Merge added examples for TRIM

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
Syntax:
47
47
 
48
 
CONCAT_WS(separator str1, str2,....)
 
48
CONCAT_WS(separator, str1, str2,....)
49
49
 
50
50
For example:
51
51
 
74
74
 
75
75
[remstr] is optional (if it's not specified, spaces are removed).
76
76
 
 
77
For example:
 
78
 
 
79
.. code-block:: mysql
 
80
 
 
81
        SELECT TRIM(BOTH 'hello,' FROM 'hello,Drizzlehello,');
 
82
 
 
83
Returns: 'Drizzle'
 
84
 
77
85
.. _ltrim-function:
78
86
 
79
 
LTRIM
 
87
LTRIM 
80
88
-----
81
89
 
82
90
This version of the TRIM function removes leading spaces from the beginning of a string.
83
91
 
 
92
For example:
 
93
 
 
94
.. code-block:: mysql
 
95
 
 
96
        SELECT LTRIM('   Drizzle');
 
97
 
 
98
Returns: 'Drizzle'
 
99
 
84
100
.. _rtrim-function:
85
101
 
86
102
RTRIM
88
104
 
89
105
This version of the TRIM function removes trailing spaces from the end of a function. 
90
106
 
 
107
For example:
 
108
 
 
109
.. code-block:: mysql
 
110
 
 
111
        SELECT RTRIM('Drizzle   ');
 
112
 
 
113
Returns: 'Drizzle'
 
114
 
91
115
.. rubric:: Footnotes
92
116
 
93
117
.. [1] If the separator is NULL then the result is NULL.