<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>String Parsing &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/string-parsing/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 20 Nov 2017 05:47:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>MySQL String Functions</title>
		<link>https://www.dbrnd.com/2015/05/mysql-string-functions/</link>
					<comments>https://www.dbrnd.com/2015/05/mysql-string-functions/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 19 May 2015 12:53:57 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[String Example.]]></category>
		<category><![CDATA[String Functions]]></category>
		<category><![CDATA[String Parsing]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=113</guid>

					<description><![CDATA[In this post, I am sharing few essential string manipulation functions of MySQL. Below is a list of String functions with an example. CONCAT (Str1,Str2&#8230;):This function is used to concat two or more string and integer by passing a string or integer arguments. If you try to concat NULL with string, the result will be [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F05%2Fmysql-string-functions%2F&amp;linkname=MySQL%20String%20Functions" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F05%2Fmysql-string-functions%2F&amp;linkname=MySQL%20String%20Functions" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F05%2Fmysql-string-functions%2F&amp;linkname=MySQL%20String%20Functions" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F05%2Fmysql-string-functions%2F&amp;linkname=MySQL%20String%20Functions" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F05%2Fmysql-string-functions%2F&amp;linkname=MySQL%20String%20Functions" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F05%2Fmysql-string-functions%2F&amp;linkname=MySQL%20String%20Functions" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F05%2Fmysql-string-functions%2F&#038;title=MySQL%20String%20Functions" data-a2a-url="https://www.dbrnd.com/2015/05/mysql-string-functions/" data-a2a-title="MySQL String Functions"></a></p><p>In this post, I am sharing few essential string manipulation functions of MySQL. </p>
<p>Below is a list of String functions with an example.</p>
<div>
<p><b>CONCAT (Str1,Str2&#8230;):</b>This function is used to concat two or more string and integer by passing a string or integer arguments. If you try to concat NULL with string, the result will be NULL. You can also concat multiple arguments using a single function.</p>
</div>
<pre class="crayon-plain-tag">mysql&gt; SELECT CONCAT('String',' Function') AS CONCAT;
+-----------------+
| CONCAT          |
+-----------------+
| String Function |
+-----------------+

mysql&gt; SELECT CONCAT('String',' Function',' Demo') AS CONCAT;
+----------------------+
| CONCAT               |
+----------------------+
| String Function Demo |
+----------------------+

mysql&gt; SELECT CONCAT('String',' Function',null) AS CONCAT;
+--------+
| CONCAT |
+--------+
| NULL   |
+--------+

mysql&gt; SELECT CONCAT('String',' Function ',10) AS CONCAT;
+--------------------+
| CONCAT             |
+--------------------+
| String Function 10 |
+--------------------+</pre>
<p><b>LEFT (str,len):</b> This will return left most character from string and if you pass NULL argument, returns NULL result.</p><pre class="crayon-plain-tag">mysql&gt; SELECT LEFT ('String Function',5);

+----------------------------+
| LEFT ('String Function',5) |
+----------------------------+
| Strin                      |
+----------------------------+

mysql&gt; SELECT LEFT (15245,3);
+----------------+
| LEFT (15245,3) |
+----------------+
| 152            |
+----------------+</pre><p>
<p><b>RIGHT (str,len) :</b> This will return right most character from string and if you pass NULL argument, returns NULL result.</p><pre class="crayon-plain-tag">mysql&gt; SELECT RIGHT('String Function',5);

+----------------------------+
| RIGHT('String Function',5) |
+----------------------------+
| ction                      |
+----------------------------+</pre><p>
<p><b>INSTR (str,substr) :</b> This function is used to find starting position of given substring.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT INSTR('String Function','Fun');
+--------------------------------+
| INSTR('String Function','Fun') |
+--------------------------------+
|                              8 |
+--------------------------------+</pre>
<p><b>LOCATE (substr,str) :</b> This function work same as INSTR(str,substr)</p><pre class="crayon-plain-tag">mysql&gt; SELECT LOCATE('Fun','String Function');
+---------------------------------+
| LOCATE('Fun','String Function') |
+---------------------------------+
|                               8 |
+---------------------------------+</pre><p>
<p><b>POSITION (substr IN str) :</b> This function work same as INSTR(str,substr)</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT POSITION('Fun' IN 'String Function');
+--------------------------------------+
| POSITION('Fun' IN 'String Function') |
+--------------------------------------+
|                                    8 |
+--------------------------------------+</pre>
<p><b>INSERT(str,pos,len,newstr) :</b> This function is used to overwrite new string part on an old string part.<br />
You require passing position and length to replace old part of string using the new part of a string.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT INSERT('String Function',7,4,'Demo');
+--------------------------------------+
| INSERT('String Function',7,4,'Demo') |
+--------------------------------------+
| StringDemoction                      |
+--------------------------------------+</pre>
<p><b>LENGTH(str):</b> This function is used to find length of given string.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT LENGTH('String Function');
+---------------------------+
| LENGTH('String Function') |
+---------------------------+
|                        15 |
+---------------------------+</pre>
<p><b>UPPER(str) / LOWER(str) :</b> This both function is used to change string from lower to upper or upper to lowar case.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT LOWER('FUNCTION');
+-------------------+
| LOWER('FUNCTION') |
+-------------------+
| function          |
+-------------------+

mysql&gt; SELECT UPPER('function');
+-------------------+
| UPPER('function') |
+-------------------+
| FUNCTION          |
+-------------------+</pre>
<div>
<p><b>REPEAT (str,count):</b> This function is used to repeat string by given count.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT REPEAT(' String Function',3);
+-----------------------------------------------------+
| REPEAT(' String Function',3)                        |
+-----------------------------------------------------+
|  String Function String Function String Function    |
+-----------------------------------------------------+</pre>
<p><b>REPLACE(str,from_str,to_str):</b> This function is used to replace a substring by the new string. You can replace any part of string by giving from_string and to_string.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT REPLACE('String Function','Function','Demo');
+----------------------------------------------+
| REPLACE('String Function','Function','Demo') |
+----------------------------------------------+
| String Demo                                  |
+----------------------------------------------+</pre>
</p></div>
<div></div>
<p><b>REVERSE(str) :</b> This function is used to reverse each word of string.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT REVERSE ('String Function');
+-----------------------------+
| REVERSE ('String Function') |
+-----------------------------+
| noitcnuF gnirtS             |
+-----------------------------+</pre> </p>
<p><b>STRCMP(str1,str2):</b> This function is used to compare two string. This is not case sensitive. If both strings match, then it returns 0 else it returns 1 or -1 base on how first string is bigger than the second string.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT STRCMP('String','String');
+---------------------------+
| STRCMP('String','String') |
+---------------------------+
|                         0 |
+---------------------------+

mysql&gt; SELECT STRCMP('STRING','string');
+---------------------------+
| STRCMP('STRING','string') |
+---------------------------+
|                         0 |
+---------------------------+

mysql&gt; SELECT STRCMP('STRING','Function');
+-----------------------------+
| STRCMP('STRING','Function') |
+-----------------------------+
|                           1 |
+-----------------------------+

mysql&gt; SELECT STRCMP('String', 'tring');
+---------------------------+
| STRCMP('String', 'tring') |
+---------------------------+
|                        -1 |
+---------------------------+</pre> </p>
<p><b>SUBSTRING (str,pos) :</b> This function is used to return sub part of string by giving position.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT SUBSTRING('String Function',5);
+--------------------------------+
| SUBSTRING('String Function',5) |
+--------------------------------+
| ng Function                    |
+--------------------------------+</pre> </p>
<p><b>SUBSTRING (str,pos,len):</b> This function is used to return sub part of string by giving position and length of return string.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT SUBSTRING('String Function',5,8);
+----------------------------------+
| SUBSTRING('String Function',5,8) |
+----------------------------------+
| ng Funct                         |
+----------------------------------+</pre> </p>
<p><b>TRIM (str):</b> This function is used to remove all prefixes or suffixes from string. You can also use LTRIM(str) and RTRIM(str) to remove space from the left or right only.</p>
<pre class="crayon-plain-tag">mysql&gt; SELECT TRIM(' Test ');
+----------------+
| TRIM(' Test ') |
+----------------+
| Test           |
+----------------+</pre> </p>
<p>Above all are basic and important String manipulation function in MySQL.</p>
<div></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/05/mysql-string-functions/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
