Questions tagged [character-trimming]
39 questions
3
votes
2 answers
Trim double quotation mark(") from a string
I have a string and I need to delete following characters
\ " { ] }
from a string. Everything working fine except the double quotation mark.
My string is :
{"fileId":1902,"x":38,"y":97}
after the following operations are performed: …

Mahmut Acar
- 713
- 2
- 7
- 26
3
votes
2 answers
Hiding middle-dash in mini-cart (theme functions.php)
I am currently preparing an online store based on Woocommerce, but I have a problem with the appearance of a mini-cart. Whenever the name of a particular product is too long, it causes the problems with the mini-cart ( which do not fit to…

user3282071
- 131
- 1
- 2
- 7
2
votes
3 answers
Remove trailing .0 from strings of entire DataFrame
Hi I would like to remove all ".0" at the end of a string for an entire DataFrame and I need it to be an exact match.
Let's make an example df:
a b c
20 39.0 17-50
34.0 .016.0 001-6784532
The desired output:
a b c
20 …

Pythn
- 171
- 2
- 10
2
votes
3 answers
RTRIM a pattern, not all the characters
I have strings like these:
JAPANNO
CHINANO
BROOKLYNNO
I want to delete the 'NO' from all of the strings. I tried this:
rtrim(string, 'NO')
but for example in the case of BROOKLYNNO, I got this:
BROOKLY.
It deletes all the N-s from the end. How can…

Looz
- 377
- 2
- 14
2
votes
3 answers
rtrim php equivalent in C#
I would like to know how to accomplish the
PHP
query = rtrim($query, '& ');
in C# ASP .NET MVC
I have tried Strings.RTrim("string") but it does not work.
Have also tried query = query.Trim(query, "&"); but it gives me error.
Also msdn provides code…

Web Dev Guy
- 1,693
- 3
- 18
- 42
2
votes
5 answers
How to trim a String using Swift 3
My code snippet is:
unwanted = " £€₹jetztabfromnow"
let favouritesPriceLabel = priceDropsCollectionView.cells.element(boundBy: UInt(index)).staticTexts[IPCUIAHighlightsPriceDropsCollectionViewCellPriceLabel].label
let favouritesPriceLabelTrimmed =…

Saintz
- 69
- 7
1
vote
1 answer
Extact match the trimming_text in the rtrim function
If I run the following query in Postgres or Snowflake, it will remove test from the end of the input string, even though the trimming text is best:
SELECT rtrim('rtrimtest',…

Saqib Ali
- 3,953
- 10
- 55
- 100
1
vote
1 answer
How to remove leading spaces and/or "/" or "\"
I am new to VBA in Excel. I have a spreadsheet that always has 172 columns. A:FP. It may have 2 to many rows. For every cell in the spreadsheet, I want to remove all leading and trailing spaces along with any leading or trailing "/" or "\". A string…

Gianmarco
- 13
- 2
1
vote
2 answers
How to use trim with array_map in PHP
I am trying to remove two characters from the end of each line (if they exist) in an array map.
These characters do not always exist
So I am trying to convert
Array ( [0] => C7130A-B [1] => RB2-8120 [2] => RM1-1082-000B [3] => 0950-4768B [4] =>…

Jesse
- 33
- 3
1
vote
2 answers
Oracle Trim trailing whitespace
SELECT user_id
FROM
USER_DUMPS
WHERE USER_ID like 'AB%'
I need to trim the whitespace from the right side of the USER_DUMPS table results. Results have 3 whitespaces.

pthfndr2007
- 93
- 1
- 10
1
vote
4 answers
Remove the last charater from string which is generated in loop
Believe me, I have tried everything that is there in stack overflow!
So, I got this JSON -
$j={
"itempicture": [
{
"status": "3"
},
{
"ItemCode": "001",
"ItemImage": "image1",
…

Abhijeetc50
- 79
- 2
- 11
1
vote
5 answers
Why does SQL Server apply RTRIM before Insert?
I have a table with a Unique Key on columns Pfx, Bse and Sfx.
While inserting data, it seems to me like SQL Server is internally applying an RTRIM and causing an issue with my Sfx column which has a space in the second row. Is it possible to prevent…

rsreji
- 170
- 1
- 1
- 17
1
vote
4 answers
Trim leading zeroes if it is numeric and not trim zeroes if it is alphanumeric
In a column, there are numeric and alphanumeric values starting with '0'.
How to trim leading zeroes if it is numeric and should not trim zeroes if it is alphanumeric in Oracle.
I need to use it in WHERE Condition.
Ex.
000012345 should be…

Selvathalapathy S
- 27
- 5
1
vote
2 answers
SQL - Remove double semicolons at the end of field
We are using Amazon-Redshift (PostgreSQL compliant syntax), we have the following string in a table
"TOTO;"
"TOTO;;"
"TOTO;;;"
"TOTO;;;;"
I would like to 'rtrim' double semicolons. So I would like to have
"TOTO;"
"TOTO"
"TOTO;"
"TOTO"
How to do…

user3615208
- 45
- 6
1
vote
1 answer
Why is rtrim removing more characters, and giving weird output?
I am trying to remove last few characters from the string using rtrim.
i have string "Scryed (download torrent) - TPB"
i want output string "Scryed"
e.g.
$title_t = "Scryed (download torrent) - TPB";
echo ($title_t) ;
echo "\n";
$title = ( rtrim…
user1642018