Questions tagged [character-trimming]
39 questions
0
votes
2 answers
RTRIM does not remove spaces at the end?
I have used the Query:
update Table
set Seg = RTRIM(Seg)
This still doesn't remove the extra spaces at the end? I really need to remove this as I am doing vlookups in Excel and it is causing problems.
The datatype of Seg column is…

Sorath
- 543
- 3
- 10
- 32
0
votes
1 answer
Removing excess comma in PHP output string
I want to remove the excess comma in my output string inside a parenthesis.
$data= "item_id IN ( '1','2',) AND nt_id IN ( 'er1','er2',) AND";
I removed the Excess 'AND' by using rtrim funtion.
$trimValues = rtrim($data,'AND') ;
But how can I…

Amboom
- 156
- 1
- 13
0
votes
3 answers
Deleting character from the end of un array
I use this code to display first letters from a string where $atit is an array of that string and results must be something like "R. & B. & T.". But this code displays results like "R. & B. & T. &".
Is it possible to get rid of the last "&"? I tried…

nisr
- 75
- 1
- 9
0
votes
2 answers
How to get a link then take some characters out? PHP
So i made a global.php but on the header i am trying to make it go in between the pages so i can edit it easier so i am using that file but i have it highlight the page on the header you are on so how can i get the link so i can take out the…

16austin16
- 17
- 9
-1
votes
3 answers
PHP rtrim to Remove the Last Space and What Follows
In PHP how to use trim() or rtrim() to remove the last space and the characters after?
Expample:
Any Address 23B
to become
Any Address
AND
Another Address 6
to become
Another Address

medk
- 9,233
- 18
- 57
- 79
-1
votes
4 answers
PHP rtrim function trim extra character? Why?
How does rtrim work? I have a string "4dbb3dca&". I am not sure how my string is formmated.
I want to call rtrim('4dbb3dca&', '&')
--edit:& might be $amp; special character issue
But after my string is 4dbb3dc.
I expect it to be 4dbb3dca.
Is…

Aipo
- 1,805
- 3
- 23
- 48
-1
votes
3 answers
remove trailing backslash from string
I would like to remove the trailing backslash from a string without using stripslashes() or str_replace(). Ideally I would be able to use rtrim(), but its something about the backslashes that has PHP freaking out.
$string = "This is my…

Niko Johnson
- 31
- 1
- 5
-2
votes
1 answer
Displaying a list of names and adding a comma & and to the last name on the list using php
I want to display a list of names and separate them with a comma and the last name should be separated with an "and" using php. Please I need help.
Here is my code:
-3
votes
2 answers
Trim "-" from data returned from SQL Server
I have a query that in SQL Server that returns data like this:
1234-A
2345-BB
3456-C
5678-CC
4567-AA
6789-B
01234-A
26857-ZZ
This is what I need it display:
A
B
C
C
A
B
A
Z
I need to get the first letter…

N West
- 1
- 4