What symbol specifies the beginning of a query string?
-
@
-
#
-
$
-
%
-
?
To solve this question, the user needs to know about Uniform Resource Identifier (URI) and URL components.
A query string is a part of a URL that contains data to be passed to web applications. It begins with a question mark (?) symbol, which specifies the beginning of a query string.
Now, let's go through each option and explain why it is right or wrong:
A. @ : This symbol is used for specifying the username and password in the URL, not for the query string. Therefore, this option is incorrect.
B. #: This symbol is used for specifying the HTML anchor tag. It is not used for the query string. Therefore, this option is incorrect.
C. $: This symbol is not used for any URL components, including the query string. Therefore, this option is incorrect.
D. %: This symbol is used for URL encoding and decoding special characters. It is not used to specify the beginning of a query string. Therefore, this option is incorrect.
E. ?: This symbol is used to specify the beginning of a query string in a URL. Therefore, this option is correct.
The Answer is: E
In a URL, the question mark (?) marks the boundary between the resource path and the query string, e.g. page.php?id=5&name=test — everything after ? is parsed as key=value pairs. The other symbols have different roles: @ sometimes denotes user-info in a URL (rare, before host), # marks a fragment/anchor identifier (after the query string, not before it), $ and % have no standard role in URL query-string syntax (though % is used for percent-encoding individual characters). So ? is the correct delimiter that begins the query string.