Re: Insert a space between each character

From: Michael Toews <mwtoews(at)sfu(dot)ca>
To: Nicholas I <nicholas(dot)domnic(dot)i(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Insert a space between each character
Date: 2008-09-17 06:50:21
Message-ID: 48D0A8AD.10104@sfu.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Use a regular expression, e.g.:

select trim(regexp_replace('foobarbaz', '(.)', E'\\1 ', 'g'));

See http://www.postgresql.org/docs/8.3/static/functions-matching.html
for more.
+mt

Nicholas I wrote:
> Hi,
>
> can anybody help me, to insert a space between each character in
> postgresql.
>
> for example,
>
> ABC
>
> output
> A B C
>
> -Dominic

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message James Kitambara 2008-09-17 06:50:51 May I have an assistance on CREATE TABLE Command
Previous Message A. Kretschmer 2008-09-17 06:39:48 Re: Insert a space between each character