title: PostgreSQL 9.3: STUFF and CHARINDEX function
body: <p>I want to retrieve some part of given string.</p>
  
  <p>Here is the following example for the string:</p>
  
  <p><strong>Example</strong>: In SQL Server </p>
  
  <pre><code>Declare @Names varchar = 'H1,H2,H3,'
  
  SELECT STUFF(@Names,1,CHARINDEX(',',@Names,0),'');
  </code></pre>
  
  <p>After referring this : <a href="https://stackoverflow.com/questions/14119517/stuff-and-for-xml-path-from-sql-server-in-postgresql">&#39;stuff&#39; and &#39;for xml path(&#39;&#39;)&#39; from SQL Server in Postgresql</a>. </p>
  
  <p><code>String_agg</code> can't help me for this scenario.</p>