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
1
vote
1 answer

Set the center with autoLayout between 2 elements in storyboard

How can I set the green button(right Button) center between the "Enter Button" and "panel image". I want to set the green button center like below photo. At the red button(left button), I can set the autolayout property in storyboard like below,…
dickfala
  • 3,246
  • 3
  • 31
  • 52
1
vote
1 answer

htaccess simple Redirect doesn't work with trailing slash

I find a lot of answers to this question (and I have read dozens of them), but they are all about more advanced stuff with patterns and such stuff. I just need a very simple and basic redirect for static urls. If I add a trailing slash to the url,…
Fanmade
  • 307
  • 4
  • 14
1
vote
1 answer

How to add a traling slash

I have the follow code in my htaccess: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z]{2})/?$ index.php?lang=$1 RewriteRule ^([a-z]{2})/([a-z]+)$ …
Simon Vetterli
  • 161
  • 3
  • 13
1
vote
2 answers

Mysql trailing trim regex cut string

I have rows blablabla-blabla-bla-code1236 blablabla-blabla-bla-code23 trying to cut everything after -code SELECT TRIM(TRAILING '-code*' FROM mycol) FROM mytable; What should I put after -code to match all -code* variations. Thanks another…
Dmitriy K
  • 177
  • 1
  • 4
  • 11
1
vote
1 answer

Adding a trailing slash after url moves the box below the menu & logo over it

I am using codeigniter. My products page shows all the products we have and then users can click on each product_name to get more details about that particular product. So, I have declared products as the class and product_name as a function within…
strangeloops
  • 1,484
  • 2
  • 11
  • 14
1
vote
2 answers

Remove trailing 0s and decimal if necessary from string

I'm trying to remove trailing zeros from a decimal, removing the decimal if there are no more trailing zeros. This string produced from a boost's gmp_float string output of fixed. This is my attempt, but I'm getting std::out_of_range: string…
user1382306
1
vote
1 answer

Regex for password requirements, no trailing whitespace

I was unable to find correct regex for my case. I found almost perfect, but it still passes with leading spaces. Requirements: var regex = /^\s*(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+)\s*$/; var passwd = "abcdefg12345" //Passes var passwd = "…
makallio85
  • 1,366
  • 2
  • 14
  • 29
1
vote
1 answer

Removing trailing new line after printing on Mac OS X zsh

i'm trying to print stdin without the trailing new line that appears after using cat, grep, awk etc. (Mac OS X zsh) Unfortunately, echo -n doesn't work, it prints some weird character. Do you have any idea on the matter ? Thanks.
1
vote
1 answer

Removing trailing slash and redirecting html

The problem I'm having is that the first URL works and the second one doesn't. http://www.example.com/podcast/episode1 http://www.example.com/podcast/episode1/ Is there a way to redirect all trailing slash versions to the non-trailing slash…
Jeremy
  • 113
  • 2
  • 3
  • 10
0
votes
1 answer

Error with trailing slashes

I have a Wordpress website and I want for example this URL: http://mywebsite.com/tag/hola to redirect automatically to http://mywebsite.com/tag/hola/ The problem is that i couldn't put the trailing slash there. Could somebody help me? Is there…
0
votes
1 answer

Trailing slash remove bug with htaccess

I am having a problem with my htaccess. when I use this url www.example.com/test or example.com/teste/ its all ok, but when I use a url like this example.com/test it redirects to example.comtest . I am really cant understand why! here it is my…
0
votes
0 answers

Streamlit - trailing zeroes

I have a dashboard that I have created using streamlit and I am facing the issue of trailing zeroes even after applying the the following comb_target_ach = [round(float(x),1) for x in comb_target_ach] comb_target_ach = [round(x,2) for x in…
0
votes
0 answers

Conditional takeprofit/stoploss

I want to create a strategy that enter position everyday at a specific hour and when a specific condition is met. After entering position, the stoploss order is set and a take profit 1 order is set as well that closes half of the position. If the…
Spher
  • 1
0
votes
0 answers

is my .htaccess if okay? i am unable to use directores in main domain

I have used following .htaccess file #remove .php from url RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/$ $1.php RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond…
0
votes
1 answer

Which data structure and algorithm used to manage a trailing stop loss system?

Sorry for inconvenient, I wonder what data structure and algorithm used to manage a trailing stop loss system ? If we have have a system which implements trailing stop loss method, to handle a large number of user orders with different initial…