Trimming refers to the manipulation of a text string to remove leading and/or trailing whitespace (and/or ASCII control characters), or (optionally) a specified character.
Questions tagged [trim]
2454 questions
0
votes
1 answer
I want to get characters out of a string in Crystal Reports
How can i write this SQL formula in Crystal Reports?
SUBSTRING(text, 6, 4))
Sample String: A003-A113-02
Using SUBSTRING in SQL, output = A113
Tried to use the Trim function, but not getting any good result.

Gary Real
- 3
- 2
0
votes
2 answers
Issues with Trim function in VBA (Excel changing data after VBAtrim)
I am having issues with the Excel trim function. A lot of the times the data I extract is accompanied with extra white spaces after the string of information e.g., "1234566 ". I have historically used the trim function in VBA and it seems…

matc
- 29
- 4
0
votes
1 answer
Removing blank spaces from ends of array in Python
I have several arrays of lines of output in a program that use '#' and ' '. The arrays could be any combination of these two elements, i.e.
[..., #, #, #, #, ' ', ' ', ...]
[..., #, #, ' ', ' ', #, #, ...]
[..., ' ', ' ', #, #, ' ', ' ', ...]…

Callum McNeilage
- 37
- 3
0
votes
3 answers
Replace last character of string Oracle plsql
How replace last character of string with blank if last character is dots.
Example:
Select replace('Luis Nazario Ronaldo Da Lima.',' ','.') as Name from dual
union all
Select replace('Ronaldo de Assis Moreira',' ','.') as Name from dual
From first…

user_odoo
- 2,284
- 34
- 55
0
votes
1 answer
How to Edit DataTable Column Value
Excel column name may contain trailing spaces which would hit exception if the column don't match due to spaces.
I am finding ways to handle trailing spaces in the column name in datatable.
foreach (DataRow row in caseTable.Rows)
{
foreach…

gymcode
- 4,431
- 15
- 72
- 128
0
votes
1 answer
How can i remove the key which contain the value white space in PHP, Laravel?
public function store(Request $request)
{
$article = Article::create($request->only(['content']));
$categories = explode(",",$request->get('categories'));
$category_ids =[];
foreach ($categories as $category) {
…

Faisal Shikder
- 61
- 2
0
votes
1 answer
Transform HTML form in PHP include file to single line for feeding JQuery methods
I have a some.php with some php processing which also has:
I also have other.php with some jquery…

PeterC
- 1
0
votes
3 answers
SAS trim function/ Length statement
Why does this code not need two trim statements, one for first and one for last name? Does the length statement remove blanks?
data work.maillist; set cert.maillist;
length FullName $ 40;
fullname=trim(firstname)||' '||lastname;
run;

Ryan M
- 37
- 9
0
votes
3 answers
Properly trimming whitespace across an entire pandas dataframe?
I am trying to accomplish a simple task of trimming all whitespace across every column in my dataframe. I have some values that have trailing spaces after words, before words, and some columns that only contain a " " value. I want all of that…

artemis
- 6,857
- 11
- 46
- 99
0
votes
1 answer
Batch loopvariable manipulation
I have a small problem with a .bat file that I have to build to manipulate a specific .csv.
I want the .bat to read the line of the file, and then check for the first three letters of that line. At the end there should be n-files where file xxx.csv…

Phil
- 11
0
votes
2 answers
JavaScript trim all own property key names of an object?
How to trim all own (not inherited) property keys / names of an object? To trim the key name, not the property's value.
PS. Closest similar question I found is about trimming property values: javascript : trim all properties of an object
EDIT: This…

ux.engineer
- 10,082
- 13
- 67
- 112
0
votes
0 answers
LPAD without trimming for higher length strings
I have a requirement to query with following input and results.
MariaDB [db]> select LPAD('COMP1', 8, 'X');
+-----------------------+
| LPAD('COMP1', 8, 'X') |
+-----------------------+
| XXXCOMP1 |
+-----------------------+
In the…

ameenulla0007
- 2,663
- 1
- 12
- 15
0
votes
0 answers
Trim/Autofit on Change Efficiently
I modified an existing on-change macro in a sheet to automatically trim and autofit columns whenever a cell in a range is changed. It works, but I had two questions I was hoping to find answers for here: is there a way to set the targeted range to…

Alexander Gaskie
- 1
- 2
0
votes
1 answer
php keep only the first 4 lines of a text file when uploading
I'm using the following code to upload a txt file to my server..

Glen Keybit
- 296
- 2
- 15
0
votes
1 answer
FFMPEG multiple steps in a batch process
I'm new to using ffmpeg for modifying video content, and I was looking for help creating a command to do the following:
Trim the first 4
Trim the last 4 seconds of a video
Add a 1 second fade to beginning and end
Include a watermark in the bottom…

kmancusi
- 591
- 3
- 20