Regular expressions, in my opinion, can be a very powerful text search and
replace engine if you know how to use it.Feel free to enhance what I provided
below; it seems to work for the example you provided.
postgres=# select regexp_replace(substring('Class V,Class VI,Class
VII,Competitive Exam,C
On Sat, 16 May 2020 23:18:57 +0800
Alex Magnum wrote:
> Hi,
>
> I have a string that I want to cut to 60 char and then remove the last
> field and comma.
>
> substring('Class V,Class VI,Class VII,Competitive Exam,Class
> VIII,Class X,Class XI,Class IX,Class XII',1,60);
>
> substring | Class V,
On 16.05.20 17:18, Alex Magnum wrote:
> Now I try to remove the last field and comma ",Class"
>
> To get Class V,Class VI,Class VII,Competitive Exam,Class VIII
>
> Is there a function or easy way to do this?
> Any help would be appreciated.
>
Hi Alex
Many options to do this with regexp_
On Sat, May 16, 2020 at 10:19 AM Alex Magnum wrote:
> Hi,
>
> I have a string that I want to cut to 60 char and then remove the last
> field and comma.
>
> substring('Class V,Class VI,Class VII,Competitive Exam,Class VIII,Class
> X,Class XI,Class IX,Class XII',1,60);
>
> substring | Class V,Class
On 5/16/20 9:31 AM, PALAYRET Jacques wrote:
Hello,
Perhaps, a statement like :
substring(theString, 1, length(theString)-position(',' IN
reverse(theString)))
with theString 'Class V,Class VI,Class VII,Competitive Exam,Class
VIII*,Class' for example.
That's cool. I did a little fiddli
Hello,
Perhaps, a statement like :
substring(theString, 1, length(theString)-position(',' IN reverse(theString)))
with theString 'Class V,Class VI,Class VII,Competitive Exam,Class VIII*,Class'
for example.
Regards
- Météo-France -
PALAYRET JACQUES
DCSC/MBD
jacques.palay...@meteo.
Hi,
I have a string that I want to cut to 60 char and then remove the last
field and comma.
substring('Class V,Class VI,Class VII,Competitive Exam,Class VIII,Class
X,Class XI,Class IX,Class XII',1,60);
substring | Class V,Class VI,Class VII,Competitive Exam,Class VIII*,Class*
Now I try to remov