I have one column for comment and I need to show this for one report. Here what happen some time, users uses multiple enters in comment box. I can not access code part I need to manage this thing in SQL only.
So I have removed unwanted
1 /r/n
2 /n/n
from using
REPLACE(REPLACE(Desc, CHAR(13)+CHAR(10), CHAR(10)),CHAR(10)+CHAR(10), CHAR(10)) as Desc,
Now I want to remove any \r
or \n
from starting or ending of the string if any
1. Remove first N characters with formula/UDF 2. Remove last N characters with formula/UDF 3. Batch remove N characters from left or right or mid without formulas 4. Download sample file 1. Remove first N characters with formulas In this part, I introduce three different ways to quickly remove first N characters from a string.
If you only need to remove something from the start and end only, you should use the str.strip () method. The str.replace () method two arguments as input, first is the character or string you want to be replaced, and second is the character or string you want to replace with.
We can not remove all char (10) or char (13) . For Example " ABCXYZ " Consider here before ABC we have char (10) or char (13) then only we need to replace it. same WAY if it's at end of the string after XYZ then only we need to perform replace for char (10) or char (13) .
Now let’s learn how to use the Python string .translate () method to do just this. Similar to the example above, we can use the Python string .translate () method to remove characters from a string. This method is a bit more complicated and, generally, the .replace () method is the preferred approach.
By the way you meant in your question:(Remove char(10) or char(13) from specific string)
Note: You should see the output result by switching your resultset output to Results to Text(Ctrl+T).
Results to Text
Results to Grid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With