You work as a developer at ABC.com. The ABC.com network consists of a single domain named
ABC.com.
You have been tasked with creating an application allows users to enter time and dates. You are
writing code that includes a DateTime method, which converts the indicated string representation
of a date and time to its DateTime equivalent using the specified format, culture-specific format
information, and style. The method requires the format of the string representation to match the
specified format exactly. The method then returns a value that indicates whether the conversion
was successful.
Which of the following is the DateTime method that is being included?
A.
TryParse(String, DateTime)
B.
TryParse(String, IFormatProvider, DateTimeStyles, DateTime)
C.
TryParseExact(String, String, IFormatProvider, DateTimeStyles, DateTime)
D.
TryParseExact(String, String[], IFormatProvider, DateTimeStyles, DateTime)
Explanation:
C
Why C please?
https://msdn.microsoft.com/en-us/library/h9b85w22%28v=vs.110%29.aspx
Should be D as it accepts array of formats?
C
(String, String, ….) not (String, String[], …)
Usually posts some incredibly intriguing stuff like this. If you are new to this site.
Check beneath, are some totally unrelated websites to ours, even so, they are most trustworthy sources that we use.
C seems to be more appropriate because the question implies the use of a single specific format, not more possible formats.
D would have been correct if you needed to match against multiple formats, hence the array of formats.