Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the name of the question mark in my URL?

http://example.com/foo.aspx?foo=bar

I'm refactoring and need to name the constant which will hold only the question mark character of this string. I'm not sure what best to name the variable, as I've never known what the proper name of that question mark was.

What should I name the constant? Or... is there something in .NET that's the wiser choice here (something built-in whose value is already that question mark -- or that builds a querystring for me automatically given a name/value pair collection)?

like image 832
lance Avatar asked Jan 25 '10 14:01

lance


People also ask

How do I change the question mark in URL?

A question mark URL encodes as %3F . But you should use a proper encoder for the whole thing rather than manually encoding a character. Show activity on this post. According to my experience of trying to make a JavaScript search engine that links to Google, just replace the question marks with %3F.

Can you have a question mark in a domain name?

Frequently asked questionsA domain name can only contain the letters A-Z, the digits 0-9 and hyphen (-), in addition to one punctuation (.) used for grouping the domains in hierarchies, e.g. under . no or .com.


1 Answers

In this document, it's literally called the "question-mark" (hyphen included) (http://www.ietf.org/rfc/rfc2396.txt -- scroll down to 3.2 Authority Component).

I agree it's a bad name. The hash (#) is called the "Fragment Identifier" (scroll down to 4.1). So maybe it should be called the "Query Identifier".

like image 80
Keltex Avatar answered Sep 28 '22 05:09

Keltex