Remove a particular character from string in postgresql

In order to remove a particular character from string in postgresql we will be using translate() function. With the help of translate() function a particular character from string is removed. Let’s see how to

  • Remove a particular character from string in postgresql

We will be using summerfruits table.

Remove a particular character from string in postgresql 1

 

Remove a particular character from string in postgresql

Removing a particular character from string in postgresql is accomplished by using translate() function as shown below

select *,translate(name,'e','') as New_Name from summerfruits

Character ‘e’ is removed from Colour column. So the resultant dataframe will be

Remove a particular character from string in postgresql 2

 

                                                                                                         

Author

  • Sridhar Venkatachalam

    With close to 10 years on Experience in data science and machine learning Have extensively worked on programming languages like R, Python (Pandas), SAS, Pyspark.