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.

2454 questions
0
votes
3 answers

How to remove extra spaces in CSV header

In Mulesoft (version 4.2.1), I'm getting CSV file as input and in headers, I'm getting some spaces along with header name, which I'm not expecting. For example, I'm getting, 'FirstName ' instead of 'FirstName'. How to remove extra spaces from…
Kiran
  • 29
  • 1
  • 8
0
votes
0 answers

Trimming a String then printing index of internal spaces

Given this example: package com.company; public class Main { public static void main(String[] args) { String myStr= "Hello World "; myStr.trim(); int i1= myStr.indexOf(" "); System.out.println(i1); } } What…
harvy666
  • 3
  • 3
0
votes
1 answer

Consolidate and Count Strings with New Line Breaks and Without

I have to write a little script that goes through a set of strings and compares them. The script basically counts the strings and will return any row that is duplicate (or has a count > 1) select data_string, count(data_string) from #facts group by…
YelizavetaYR
  • 1,611
  • 6
  • 21
  • 37
0
votes
2 answers

how to use replace on a left join statement

I have two tables, one of them has a field with strings like that '1111AAA', the other one has the same field but with this structure '1111 AAA'. I want to replace the blank space with '', but I have an error near the ON of the left join. I put the…
Imrik
  • 674
  • 2
  • 14
  • 32
0
votes
2 answers

removing line breaks in php

As the title reads I am using the echo function to create an h3 string which will insert a php value $lowprice and $highprice. The goal is to have the text read Here are all the houses whos prices are between $lowprice and $highprice. The code…
0
votes
2 answers

PHP Delete txt line and then remove line works BUT if the delete is the last line, it won't remove blank line

Use code below to delete a line from a text file. If the deleted item is NOT the last element, it works fine. Deletes the line entirely. $panel_dir = 'host.txt'; $panel_data = file($panel_dir); $panel_out = array(); …
Vimmy
  • 71
  • 1
  • 7
0
votes
1 answer

Java - How to convert blank spaces into another string using trim() method?

I am having trouble figuring out how to ge the program to reject inputs that contain only white spaces and changing it into the string "N/A" with the trim() method. I have also tried to use the replaceAll() methods, but they aren't working…
VGSO15
  • 15
  • 3
0
votes
1 answer

how can i use the trim() method to make this work? I need to read the txt file while ignoring the blank line and lines that start with "//"

public void readToooooolData(String fileName) throws FileNotFoundException { File dataFile = new File(fileName); Scanner scanner = new Scanner(dataFile); scanner.useDelimiter("( *, *)|(\\s*,\\s*)|(\r\n)|(\n)"); …
azzy
  • 21
  • 2
0
votes
3 answers

Trimming or cutting a a part of a string in java

I've a string, "শাকসবজি কিনুন". How can I cut off the " কিনুন" part of this string in java? Having issue over here because of Unicode. I tried this : String y1 = "শাকসবজি কিনুন"; System.out.println(y1); y1 = y1.replace(" কিনুন",…
user10767069
0
votes
0 answers

Automatically read video and trim

So I am a gamer who loves editing videos and creating montages. I play a game called Apex Legends, and find that when editing long videos (Up to 5 hours long) I follow the same procedure every time. I skip ahead in the video until I see when I get a…
0
votes
1 answer

How to subset rows in a dataframe in R according to mean of variable?

I have a dataframe in R with 120 observations (participants). The mean age of all the sample is 51 years old (range 25-90). I would like to randomly select 60 of these observations to have a mean of 40. Is there a way of doing this? I would prefer…
Audrey
  • 33
  • 4
0
votes
1 answer

Remove numbers from beginning of strings in a numbered list with SQLite

I have a long numbered list imported into a table, the strings are in the following format: 1. fdhsglahs sdhkgs 2. urgbvdgh ndovh 3. 8yhbnxjghr nvdfo dfhioj ... 9999. vnur neeu nu I want to remove the numbers in the beginning of the string, the "."…
Ofer Chen
  • 3
  • 3
0
votes
0 answers

Is there a way to separate a few seconds from the beginning of an audio file?

I want to set up a 30-second audio file for the notification sound But I have to separate the first 3 seconds or 4 seconds from this song and then adjust. Is there a way?
A.ebrahimi
  • 33
  • 1
  • 7
0
votes
4 answers

triming a string

This may be dumb but I've been beating my head against it for a bit now.. $values contains this text: '58','val','val','val','2011-05-12 21-41-42','','0','micahstesttest', Why won't this trim the last comma? trim($values, ","); EDIT - this is how…
doub1ejack
  • 10,627
  • 20
  • 66
  • 125
0
votes
1 answer

Is their any way to split video into multiple segment using ffmpeg in android?

I want to trim video into 30 seconds multiple segments in android studio.I have used the following command to trim video into 30 seconds but this is not the way i want,its just trimming video into 30 sec.Is there any FFmpeg command available to…