Questions tagged [trailing]

Trailing characters are characters at the end of a string that should be removed for reason (eg. trailing zeros in "0.5000", trailing spaces in "hello ", trailing slash in a URL, trailing newline character, etc.).

This tag should be used for questions related to strings formatting issues, either when the goal is to parse the string or to display it. However context may be very different from one question to the other, and this tag covers a wide area.

217 questions
3
votes
1 answer

How can I keep trailing zeros in a list or np.array?

I'm performing a little bit of statistics using python, I have this dataset: test=[0.200,0.220,0.220,0.120,0.330,0.330] Python automatically convert it in [0.2, 0.22, 0.22, 0.12, 0.33, 0.33] but in fact the zeros are significant figures in my…
G M
  • 20,759
  • 10
  • 81
  • 84
3
votes
3 answers

PHP giving a trailing "=" on each line after reading from stdin

The contents of stdin is getting corrupted with word wrapping and trailing "=" throughout which obviously breaks the URL that I need to post. I need to extract a URL/link from an email then post the URL. So, I'm piping my email to a php script in…
DSMagic
  • 125
  • 2
  • 8
3
votes
3 answers

Java SimpleDateFormat cut trailing 0-digits of SSS

hi i have an simple date format new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); It formats the date like this 2014-04-23 13:15:59.390 is it possible to remove the trailing 0, except when the digit it it is not 0? 2014-04-23 13:15:59.39 ok i've…
wutzebaer
  • 14,365
  • 19
  • 99
  • 170
3
votes
1 answer

Display trailing zero for price in jquery

Hopefully someone can help with this. I am simply looking to add the final zero to the decimal part of a price in a price calculator I am written. The calculator starts with a user selecting a standard "Sign Up" fee of €25.50 and then selecting…
damienoneill2001
  • 498
  • 7
  • 17
3
votes
2 answers

Remove trailing white space in python 3

Having bit of trouble with a program i made. i am getting it to display a diamond but i have a problem, here is my code: a = input("Enter width: ") a = int(a) b = a for i in range(a): i = i + 1 b = a - i text = " " * b + " " + "* " * i …
NoviceProgrammer
  • 257
  • 1
  • 8
  • 15
2
votes
3 answers

How to ignore trailing slash while joining two string columns in SQL

I have two tables tableA and tableB as described bellow desc tableA GUID PROPERTY_NAME PROPERY_VALUE ANOTHER_COL_1 ANTHER_COL_2 desc tableB GUID PROPERY_NAME PROPERTY_VALUE RANDOM_COL_1 RANDOME_COL_2 I have the following query to fetch the list of…
Ram
  • 3,034
  • 11
  • 38
  • 46
2
votes
2 answers

Regex match items in list + trailing N numbers (Python)

I have a list of expected animals: expectedAnimals = ['cat-', 'snake-', 'hedgehog-'] Then I have a user input (in string format) that contains some or all of the expected animals from the above list follwed by N numbers. These animals are separated…
Alex O
  • 39
  • 2
2
votes
1 answer

Flutter list view builder flexible configuration

I ve started to teach myself the Flutter dart language. I have a list view builder widget established which I want to use multiple times in the app. The list view consists of a checkbox, a Text in the middle and an information button at the…
datavinnie
  • 47
  • 5
2
votes
1 answer

A RenderFlex overflowed by 260 pixels on the bottom. - ListTile

I'm trying to add column in ListTile trailing but it gives me render flow error, plus it not align to it's title. here is my code SizedBox( height: MediaQuery.of(context).size.height * 0.55, child: ListTile( …
TimeToCode
  • 1,458
  • 3
  • 18
  • 60
2
votes
0 answers

Pine Script Tradingview - basics for position management , entry, stop loss and trailing stop

I have a strong background in VBA, Excel is my second nature. Now I've been trying to get the simplest strategy working on TView for days already but I just cant grab the logic yet. I created my own indicator and want to use it in a strategy. The…
2
votes
0 answers

Why forEach skips empty elements created by trailing commas in array?

I was reading Trailing commas and .forEach() documentations on MDN meanwhile playing with arrays. So let's imagine a scenario when you have an array with elements like Number, undefined and created ones with trailing commas and running a forEach()…
norbitrial
  • 14,716
  • 7
  • 32
  • 59
2
votes
1 answer

Why does kableExtra cell_spec lose trailing decimal zeros during conditional formatting?

I like to have two decimals, which works usually fine with kable. But using kableExtra for conditional formatting doesn't show trailing zeros if there is one cell, for which the condition is TRUE. The MWE shows a situation where I get one bold cell…
Thomas Buhl
  • 303
  • 2
  • 7
2
votes
2 answers

Is there a way to count all the trailing zeros in a column in MySQL?

I am looking to find out if there is a way to count the number of trailing zeros in a column. The column is made up of a maximum of 13 numbers as shown below and I want to count all the zeros before an actual number but not sure how to go about…
Michael Owen
  • 365
  • 3
  • 20
2
votes
3 answers

C program to find the trailing ZEROS at the end of a FACTORIAL of a given number

I have return the code to find a factorial and to display trailing zeros at the end of the factorial, but the output is wrong... could you please help me to find the mistake? #include int main() { int m = 1, i, N, count = 0; …
pop1912
  • 91
  • 1
  • 10
2
votes
1 answer

Inno Setup Compiler adding trailing spaces to executable details (ex.: FileVersion, LegalCopyright, ...)

What could be the possible cause of trailing spaces in Version Info of the resulting executable file? How to remove them ? (Removing the spaces with Resource Hacker yields the executable corrupted) This is the excerpt from Version Info, viewed with…
wonderingdev
  • 1,132
  • 15
  • 28