Questions tagged [slash]

Please do not use this tag. The / character ("forward slash", or just "slash") is a directory separator in URLs and in many operating systems including Linux (Windows uses \ (backslash) but many applications and APIs also accept /). It is also the division operator in many languages, and marks closing tags in XML/HTML. In some languages, / characters delimit regular expressions.

The slash character / (sometimes called forward slash to distinguish it from \ ) has several common meanings in computing:

  • / is the directory separator in file names on Unix-like and POSIX operating systems, including Linux. Many Windows APIs and applications accept / as a directory (folder) separator, although some require a backslash \ instead. / is also the directory separator in URLs.
  • In many programming languages, / is the division operator . When applied to integers, / returns the quotient of the division in many languages.
  • In SGML based languages including and , / marks closing tags, as in <b>bold</b> or <br />.
  • / is a common delimiter for regular expressions searches (in , , , etc.).
465 questions
19
votes
7 answers

Simple URL routes in WCF Rest 4.0 without trailing slash

I have a WCF REST 4.0 project based on the the WCF REST Service Template 40(CS). I'd like to expose simple service endpoint URLs without trailing slashes. For example: CarService.cs http://www.domain.com/cars - GET returns a list of all…
Will
  • 375
  • 1
  • 4
  • 13
18
votes
4 answers

(Swift) how to print "\" character in a string?

I have tried to print it but it just by passes because it's an escaped character. e.g output should be as follows. \correct
Rahul Sonvane
  • 3,737
  • 7
  • 18
  • 21
17
votes
4 answers

Remove all backslashes in Javascript

How to remove all backslash in a JavaScript string ? var str = "one thing\\\'s for certain: power blackouts and surges can damage your equipment."; I want output like one thing's for certain: power blackouts and surges can damage your…
user2046091
  • 369
  • 3
  • 4
  • 12
15
votes
4 answers

Converting backslashes into forward slashes using javascript does not work properly?

I have a javascript variable comming from legacy system with backslashes into forward slashes: '/46\465531_Thumbnail.jpg' and I am trying to convert into this: '/46/465531_Thumbnail.jpg'. There is no way to fix the problem on the legacy…
Junior Mayhé
  • 16,144
  • 26
  • 115
  • 161
15
votes
2 answers

How can I escape slash sign `/` in Apache `` directive's regex?

I wanted to serve .xhtml files as application/xhtml+xml if the browser says that it accepts it. text/html otherwise I tried doing it with mod_rewrite but it didn't work with Options -FollowSymLinks (see Why I do I get 403 Forbidden when viewing…
Oriol
  • 274,082
  • 63
  • 437
  • 513
15
votes
4 answers

Tomcat, JAX-RS, Jersey, @PathParam: how to pass dots and slashes?

Having a method like this: @GET @Path("/name/{name}") @Produces(MediaType.TEXT_PLAIN) public String getProperty(@PathParam("name") String name) { System.out.println(name); } How do I pass a value like "test./test"? /name/test./test …
Maxim Suponya
  • 1,419
  • 2
  • 20
  • 43
13
votes
4 answers

How to generate links with trailing slash in Rails 3?

I'm porting the existing website from PHP to Ruby on Rails 3 and I have to keep the urls unchanged. I have the route: get 'companies/' => 'companies#index', :as => :companies In a view file I have: link_to 'Companies', companies_path and this…
Aleksandr Shvalev
  • 1,005
  • 2
  • 11
  • 22
10
votes
5 answers

nginx and trailing slashes on $document_root?

I use the following configuration for nginx: http://gist.github.com/340956 However, this configuration causes a No input file specified error with PHP. The only way I have been able to solve it is by altering this line: fastcgi_param …
shadowhand
  • 3,202
  • 19
  • 23
9
votes
2 answers

django - url with automatic slash adding

I'm using django admin on my website. When I enter url without slash after admin (http://example.com/admin) I receive 404 error. I thought that django automatically added slash on the end of url. Of course when I enter url ended with slash it works…
lukasz
  • 153
  • 1
  • 1
  • 6
9
votes
6 answers

In Python, how should one extract the second-last directory name in a path?

I have a string like the following: /cvmfs/atlas.cern.ch/repo/sw/ASG/AnalysisTop/2.0.24/RootCore How should I extract the "2.0.24" from this string? I'm not sure how to split the string using the slashes (in order to extract the second last element…
d3pd
  • 7,935
  • 24
  • 76
  • 127
8
votes
2 answers

`new` and `use` keyword paths

Im on a host company that uses php 5.2 , some of the libraries i use are written in 5.3 and there are certain incompatibilities between the code. First of all what is the alternative to : use \folder1\folder2\class_file; Secondly what is the…
John Papastergiou
  • 999
  • 2
  • 14
  • 29
8
votes
4 answers

url trailing slash and seo

Which is better for SEO and page rank? mysite.com/directory/my-page OR mysite.com/directory/my-page/ I know the above two URLs are treated as two separate pages by search engines, but I'm stuck on deciding which format to consistently use and which…
Ham
  • 97
  • 1
  • 2
8
votes
6 answers

Remove additional slashes from URL

In ASP.Net it is posible to get same content from almost equal pages by URLs like localhost:9000/Index.aspx and localhost:9000//Index.aspx or even localhost:9000///Index.aspx But it isn't looks good for me. How can i remove this additional slashes…
demo
  • 6,038
  • 19
  • 75
  • 149
8
votes
2 answers

What happens when i put a slash (/) after a .php url?

I have a simple question, but could not find the answer anywhere say I have a site "mysite.com". I can access the index page by either typing "mysite.com" or "mysite.com/index.php". This works fine... however, when i try to go to…
Guy
  • 81
  • 1
  • 3
7
votes
2 answers

How to detect when (forward) slash key is pressed in OEM keys C#

I'm working on wpf c# application and I need to detect when user press "/" but I'm having trouble with finding " / " e.Key, I saw there is Key.OemBackslash and stuffs like that, but I can't find right event for " / " (forward slash) ... Thanks…
Roxy'Pro
  • 4,216
  • 9
  • 40
  • 102
1
2
3
30 31