You are developing a method that searches a string for a substring. The method will be localized to Italy.

You are developing a method that searches a string for a substring. The method will be localized
to Italy.
Your method accepts the following parameters: The string to be searched, which is named
SearchListThe string for which to search, which is named SearchValue You need to write the
code. Which code segment should you use?

A. Return SearchList.IndexOf(SearchValue)

B. Dim objComparer As CompareInfo = _
    New CultureInfo("it-IT").CompareInfoReturn objComparer.Compare(SearchList,
    SearchValue)

C. Dim objComparer As CompareInfo = _
    New CultureInfo("it-IT").CompareInfoIf SearchList.IndexOf(SearchValue) > 0 Then
    Return TrueElse
    Return FalseEnd If

D. Dim objComparer As CompareInfo = _
    New CultureInfo("it-IT").CompareInfoIf objComparer.IndexOf(SearchList,
    SearchValue) > 0 Then
    Return TrueElse
    Return FalseEnd If


Answer: D 

No comments:

Post a Comment