A function to count all ocurrences of a character within a string.

From: Piotr Czekalski <pczekalski(at)techbaza(dot)pl>
To: pgsql-sql(at)postgresql(dot)org
Subject: A function to count all ocurrences of a character within a string.
Date: 2011-03-07 21:20:14
Message-ID: 4D754C0E.4030804@techbaza.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello pgsql community,

Is there any string function (other than regex / scan & compare loop) to
obtain a list (or even a count) of characters within a string?
strpos and position seems to return only first occurence of a
char/string within substring.
The goal is to check if a string contains equal number of opening and
closing parenthesis, and if there are any of them.

Regards,

Piotr Czekalski

--

--------------------------------------------------------------
"TECHBAZA.PL" Sp. z o.o.
Technologie WEB, eDB& eCommerce
tel. (+4832) 7186081
fax. (+4832) 7003289
email: biuro(at)techbaza(dot)pl

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message bricklen 2011-03-07 22:08:10 Re: A function to count all ocurrences of a character within a string.
Previous Message S G 2011-03-02 14:24:52 Re: distinguishing identical columns after joins