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)?
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.
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.
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".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With