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
4
votes
3 answers

making apache and django add a trailing slash

My /train directory is aliased to a script in httpd.conf by: WSGIScriptAlias /train /some-path/../django.wsgi And it works well, except for one problem. If a user goes to /train (with no trailing slash) it will not redirect him to /train/, but will…
user302099
  • 635
  • 1
  • 5
  • 17
4
votes
2 answers

Print cpp_dec_float in scientific notation without trailing zeros

I'm using cpp_dec_float for arbitrary precision, and it's great, but I'm having trouble figuring out how to print all significant digits. For example, with this code to setup using boost::multiprecision::cpp_dec_float; typedef…
user1382306
4
votes
1 answer

makefile: trailing spaces in variable value

I'm reading the following in GNU make manual: if you do not want any whitespace characters at the end of your variable value, you must remember not to put a random comment on the end of the line after some whitespace, such as this: dir :=…
password636
  • 981
  • 1
  • 7
  • 18
3
votes
1 answer

Vim Highlight Trailing Whitespace AND Spaces Before and After Tabs

I got this from the vim wiki and added it to my .vimrc to highlight trailing whitespace, and spaces before tabs (only when in insert mode): highlight ExtraWhitespace guibg=purple match ExtraWhitespace /\s\+$\| \+\ze\t/ autocmd BufWinEnter * match…
user1186344
  • 31
  • 1
  • 2
3
votes
1 answer

htaccess redirect url with trailing %20

We use pretty urls on our site. I had an external technician add back links some years ago. He did a great job, but in one case, he consistently added a link with a trailing space character. https://www.example.com/item/item/%20 This has been…
user35546
  • 65
  • 1
  • 7
3
votes
3 answers

Prevent SAS to automatically remove trailing blank in string

I have a sample data set like below. data d01; infile datalines dlm='#'; input Name & $15. IdNumber & $4. Salary & $5. Site & $3.; datalines; アイ# 2355# 21163# BR1 アイウエオ# 5889# 20976# BR1 カキクケ# 3878# 19571# BR2 ; data _null_ ; set d01 ; …
EagerToLearn
  • 675
  • 7
  • 24
3
votes
1 answer

How can I make split(/\t/, $STRING) detect empty values when $STRING ends with "\t\t"?

How can I make split(/\t/, $STRING) detect empty items when $STRING ends with "\t\t"? Using Perl script, I am trying to split strings based on as a separator between items then count and use these items. But, when the strings end with a…
ahmedhelali100
  • 142
  • 1
  • 2
  • 17
3
votes
2 answers

Scapy - random trailer after a packet

I am running sacpy 2.4 in Ubuntu 16.04. I have found on basic packets ( Eth/IP/UDP or Eth/IP/TCP) wireshark often flags a failed frame check sequence. Upon investigation I found that the "broken packets" all have trailing data behind the UDP or TCP…
phenning
  • 93
  • 1
  • 6
3
votes
5 answers

Trailing Zeros - C

I need a program that returns the number of trailing zeros in the binary rapresentation of a number. I found online a function written in C but I don't understand how it works This is the function: unsigned tzr(unsigned x) { unsigned n; /*…
ekans
  • 39
  • 5
3
votes
0 answers

Allow leading and trailing space for NSTokenField

I would like to allow leading and trailing space in NSTokenField, problem is that when it loses focus, the space is being trimmed automatically. I've tried to customize delegated functions: editingStringForRepresentedObject and…
3
votes
1 answer

Excel - Add trailing zero's

In excel I have all sort of values in a column, 1 100 12 120 123 123 03 030 133 133 and I want to add zero's at the end till it reaches 3 digits. Cheers
douwe12345
  • 65
  • 1
  • 1
  • 7
3
votes
4 answers

How to remove final character in a number of strings?

I have a number of strings that I would like to remove the last character of each string. When I try out the code below it removes my second line of string instead of removing the last element. Below is my code: Code with open('test.txt') as file: …
Xiong89
  • 767
  • 2
  • 13
  • 24
3
votes
0 answers

Docker - COPY/ADD files remove the trailing line

It is really strange what is happening. I check several time. I have a docker image copying/adding a yml file to the container. This yml file has trailing line. I added three empty line to be sure. If I go to the container and do a cat those…
Clempat
  • 498
  • 4
  • 10
3
votes
2 answers

are leading and trailing whitespaces ignored in html?

html4 says this: In order to avoid problems with SGML line break rules and inconsistencies among extant implementations, authors should not rely on user agents to render white space immediately after a start tag or immediately before an end tag.…
x-yuri
  • 16,722
  • 15
  • 114
  • 161
3
votes
3 answers

Trailing zeros after sequential rounding with round() followed by signif()

I am trying to apply a sequential rounding function on any real number so that the following condition is met: "Numbers should be reported with no more than two decimal digits and no more than two significant figures". For example: 0.0236 should be…
1 2
3
14 15