Questions tagged [trim]
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.
2,354
questions
1
vote
1
answer
20
views
SwiftUI - using trim() and specifying its starting point
I'm trying to create a custom border around a textfield which leaves space for am label like this:
I am considering using trim() here but cannot work out how to get the desired effect.
So far for the ...
1
vote
1
answer
30
views
How to trim html elements and class from string in JS
I have the following string and code:
str = `<p class="">Lores Ipsimulm</p><p class="">1 x 100ml - 19% </p><p class="">1 x 100ml No.6 Mike</p><p class="">...
0
votes
1
answer
34
views
Need replace text with single quotes in SQL
I need to make a script that make a replacement of all the registers of a column that contains: '@xxxx', removing the single quotes. (xxxx could be empty or any string. The @, is neccesary, the simple ...
-1
votes
2
answers
36
views
Remove all chars up to last known char C#
I have some string:
var s = "*%hello%my%name%is%Mike%HowAreYou";
The Mike%HowAreYou is changed from object to object.
I want to trim all the start up to the last % and get HowAreYou
How can ...
0
votes
1
answer
16
views
using conditional in CASE does not evaluate expressions properly ? neo4j
I would like to trim strings server side.
Consider this: a property is string, and I want to trim it if longer than, say, 10 chars.
Consider this query:
Match (r)
with r, case r.what
when size(r....
0
votes
0
answers
20
views
i wrote this shell script using set -A with grep and now it's not working ( invalid output set )
i wrote this shell script using set -A with grep and now it's not working ( invalid output set) . the shell script is get command result of kubectl get rs --all-n and store is new txt and the setting ...
1
vote
1
answer
41
views
anything wrong with this trim() method in C
this method is for trimming a string in C by deleting spaces from the beginning and end.
BTW iam not that good with C and actually facing some issues with dealding with strings
char* trim(char s[])
{
...
0
votes
1
answer
32
views
Trim a character on SQL
Hi everyone this is my first time that i asked something.
I have multiple codes on my db with numbers and '/', for example:
510325205
510325205/000/01
510565025-01
510565025-01/090/03
...
I need to ...
0
votes
0
answers
9
views
How to trim audio with torch audio in python?
I was try to use librosa, but it's too slow... So I want to use torch-audio. But I'm having trouble in trim audio at colab. If you know it, please let me know.
0
votes
2
answers
25
views
Trimming Down Output [duplicate]
I am trying to trim down an output in some code I'm working on, and for whatever reason can't get it to work.
version= wget --output-document=- https://dolphin-emu.org/download 2>/dev/null \ | grep ...
0
votes
1
answer
32
views
Bulk trim videos : remove last x seconds from video
Hey guys i have been searching for hours but this is giving me a lot of trouble. None of the code i found worked for me.
I have a lot of videos with a different length where i want to bulk remove the ...
-1
votes
2
answers
37
views
Integrate strip or trim in python script
Thanks so much for reading my post, I hope someone can help me with that, I have a script to connect to my database and extract several tables and convert them to JSONL format ( all with pandas ), my ...
0
votes
0
answers
9
views
How to open trim audio panel in IMG.LY
I woud like to open audio trim editor in VideoEditor IMG.LY from my action. How can I do this?
Native implementation works but before that I must to open separate display and select audio from audio ...
0
votes
2
answers
56
views
Mysql TRIM/RTRIM/REPLACE doesn't work to remove trailing spaces from an email column
I have this insert select statement, copying data from employee bulk add staging to employee table:
INSERT INTO employee (tr_email)
SELECT TRIM(eb.tr_email)
FROM employee_bulkadd_staging eb
ON ...
1
vote
3
answers
41
views
Create list with value from different dynamic sheets in Google Sheets
I have a list of values in three diferent sheets that are dynamic in column A, I have to put merge the three of them into a main sheet big list.
In the image the color squares are the diferent sheets ...
0
votes
0
answers
6
views
How do I apply the trim and split methods to an ArrayList after reading a file?
public static void main(String[] args) throws FileNotFoundException {
File fileToOpen = new File("Faculty.txt");
Scanner fileInput = new Scanner(fileToOpen);
while (fileInput....
1
vote
1
answer
17
views
A component is changing an uncontrolled input to be controlled
I am trying to do the discounted price logic
Discount price should have the default value of actual price , because 0% discount means the discount price is same as actual price.
when i do this i am ...
0
votes
2
answers
24
views
Take only right word a field column in Teradata
I want to have only the right word of a string like this in Teradata?
Tim Tom Dave
How to trim Tim and Tom and only get Dave?
substring(ABC, Index(ABC, ' ') -1)
This is always from left side.
0
votes
2
answers
95
views
how to remove double quotes of a variable using trim in terraform
locals {
check_list ="test"
trimoutput = trim(local.check_list, "")
}
currently, the trim output value is still "test"
Expected output is just test. I need this ...
1
vote
2
answers
59
views
Detect integer value inside a string, alter it and leave it in the same place within the string
Lets say we have a string that looks something like this:
10.000 some text 5.200 some text 5.290 some text
What i want to do is to remove the last zero (if it is present) from all of the present int ...
1
vote
1
answer
49
views
Differences of TRIM and TRIM BOTH in Spark
I have created a Spark SQL temp view named old_ticket_df. In the temp view old_ticket_df I have a column "approver" which appears to have whitespace. I have tried to remove the whitespace ...
0
votes
1
answer
40
views
Trim Text Between Two Similar Identifiers C#
I have a string
string myString = "NotNeeded/ThisTextIsNeeded/NotNeeded";
I just need "ThisTextIsNeeded" and the starting and ending identifiers are same "/". I can use ...
0
votes
0
answers
27
views
Laravel validate "required" rule
In class TrimStrings i was added passsword or new_password to except field not trim:
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
...
1
vote
2
answers
72
views
Trim an array of an arrays (Javascript)
I know how to trim all strings in an array (thanks to this article!) through the map() method
let a = [' a ', ' b ', ' c '];
let b = a.map(element => {
return element.trim();
});
console....
0
votes
2
answers
28
views
How can I remove white spaces in a psql insert?
I have a text input:
<label for="pt"><b style="color:white"> Company name </b></label>
<input type="text" name="company" ...
1
vote
0
answers
52
views
Woocommerce Short Description display HTML
I am trying to find out how to display HTML tags within the short description on a category listing page when using Woocommerce in Wordpress.
The category listing will display a product with the ...
-1
votes
2
answers
74
views
Remove first and last word from a string(php))
I want to remove the first and last word from a string.
$string = "12121";
I tried trimming it like
$string = "12121";
$trimmed = trim($string, 1);
print($trimmed);
Result
22
And ...
-1
votes
1
answer
104
views
Trimming Substrings from String Swift/SwiftUI
Let's say I have the following strings:
"Chest Stretch (left)"
"Chest Stretch (right)"
How can I use SwiftUI to output only:
"Chest Stretch"
I thought this may be a ...
-1
votes
1
answer
29
views
How do I remove certain parts from a string in a dataset in python? [closed]
I have a data set that has a code and then a name with a code, and there multiple codes and multiple names example:
|CODE|NAME|
|TN |Tobey JacobsTN|
|GD |Lars OwensGD|
|YO |Mark SmithYO|
|BM |John ...
0
votes
0
answers
52
views
Trim method not working for Array when reading from String
I have researched plenty of .trim method questions to see if someone had my same issue but I haven't come across it and I think it's because of something I did wrong and I just can't see it.
I want to ...
1
vote
1
answer
65
views
in trim function there's an if-check not working properly, why?
EDIT: I've edited my code, and this is the result:
#include <stdlib.h>
#include <ctype.h>
char *trim(const char *s) {
if (s == NULL) {
return NULL;
}
size_t count_1 = ...
0
votes
2
answers
120
views
How to Trim the Leading and Trailing White-Spaces of a String Array in C#
I want to trim all the white-spaces and empty strings only from the starting and ending of an array without converting it into a string in C#.
This is what I've done so far to solve my problem but I'm ...
1
vote
2
answers
45
views
Perl - reading file into multidimension array
I am hoping someone can assist me, I am fairly new to Perl, I have looked and found some sample scripts but cannot get this to work.
I have input file that is generated by a SQL query:
...
0
votes
2
answers
72
views
Trimming whitespace in Array
I have been trying to trim whitespaces in my long array which consists of almost all the periodic table elements but not able to find the function that does that, I did read the documentation on trim ...
0
votes
2
answers
67
views
React dynamic form input fields typeError undefined trim()
I have a React form with dynamic input fields that a user can add and remove input fields. All inputs are required. If all input fields are filled and the form is submitted then i console.log() an ...
-1
votes
1
answer
159
views
looking for react native video trimer .react-native-video-processing not enough good
Is there any way to trim video ? I can't find any library for that.
react-native-video-processing not enough good
0
votes
3
answers
49
views
R for loop help to trim based on condition
I am new to R and struggling with for loop:
I want to split some strings in a df based on condition
my df:
I want to split where begins with "X"
to identify I am using - grepl("X."...
4
votes
4
answers
70
views
Is there a better way to clean a string?
Currently, this is my code.
function clean_string(raw_string) {
A =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890".split(
""
);
...
-3
votes
3
answers
357
views
How to remove a white space at the end of a string in java?
I am trying to remove exactly one white space at the end of a string.
eg.
I want " XXXX " to be " XXXX".
The trim() method in java removes all leading and trailing whitespaces.
...
0
votes
0
answers
70
views
How to correctly trim a string when reading/writing a file.txt in fortran90?
I'm a beginner with fortran90, I want to read a txt file that in my case is: "Simulation_Parameters.txt". This is my code:
!declarations
integer, intent(in) :: iu_input
character*150, ...
2
votes
1
answer
292
views
How to trim zeros after decimal value without changing the datatype using PySpark?
My requirement is to remove trailing zeros from decimal value, I have tried regex and strip() to remove trailing zeros it worked but we use regex and strip for string datatype, I want Col_2 to be ...
0
votes
0
answers
46
views
how to skip first 3 alpha characters from code 128 barcode in ZPL
^FO10,75^BY2^BCN,80,N,N,N,A
^FD
$Codevalue
^FS
code value stores alphanumeric value which is like AAF1234567, using the above logic, when i scan barcode it scans complete code value AAF1234567, what ...
-1
votes
3
answers
103
views
Hi i'm a newbie in c# and i'm trying to write trimleft function by myself [closed]
public static string TrimLeft(string word)
{
int numberOfLetters = 0;
foreach (var c in word)
{
numberOfLetters++;
}
int start = 0, end = ...
0
votes
0
answers
8
views
How can i specify parameters to a function, that is used in array_map in php? [duplicate]
I have this situation: i want to use a trim() php function, but inside array_map(). My trim has a second parameter, it looks like:
trim($string, ' '); // because i want to cut only spaces
and inside ...
0
votes
1
answer
65
views
How does php substr deal with two offset values? [closed]
Consider the following:
echo substr("abcdefgh", 1, -1);
// outputs bcdefg
echo substr("abcdefgh", 2, -2);
// outputs cdef
Seems like substr is taking first numeric parameter as ...
1
vote
1
answer
89
views
Sheets Merge Multiple Rows into 1 Row
I have multiple rows, each containing cells that do not overlap and I want to easily merge them into a single row with a formula. Bonus if I can also fill in the empty cells with something. In this ...
1
vote
1
answer
45
views
Arrayformula to return last non-empty cell in multiple rows
I need help formulating an arrayformula on how to return the last non-empty cell in a row across multiple rows.
The formula will be in column A in cell A2 and the output will look like this in column ...
1
vote
1
answer
44
views
Trimming white spaces in similar strings in different columns of pandas dataframe
My question is very simple and I tried all possible SO answers before asking it.
I have a dataframe
{'article_journal': {0: 'lipids', 1: 'nature reviews cardiology', 2: 'clinical research
cardiology ...
1
vote
1
answer
48
views
Write a program to trim both leading, trailing and extra whitespace characters from given string in JavaScript without using inbuilt methods?
First I tried to understand the question as a beginner and tried to build logic to find the solution of the question.
After that failing many times to build a proper logic .
Then I started to find ...
0
votes
1
answer
67
views
flutter package for trim audio
I am trying to create a flutter app with trim audio. For that, I am looking for a library to trim a audio like video_trimmer.
I have tried the audiocutter package. But the package is old and it's use ...