1.

Which of these methods of class String is used to check whether a substring exists at the beginning of the particular string?(a) StartsWith()(b) EndsWith()(c) Starts()(d) ends()The question was asked in an interview for job.I'm obligated to ask this question of Comparison of Strings in section Arrays and Strings of C#

Answer»

The correct option is (a) StartsWith()

The BEST explanation: METHOD startswith() of string CLASS is used to check WHETHER a SUBSTRING exists in the beginning of string or not.



Discussion

No Comment Found

Related InterviewSolutions