String Sort Problem

How to check a string is a prefix of another string ??

@ashwani225 hi,use string find functiom of stl:
find is used to find the first occurrence of sub-string in the specified string being called upon. It returns the index of the first occurrence of the substring in the string from given starting position. The default value of starting position is 0.

In find() what does npos means??

@ashwani225 The initial position from where the string search is to begin.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.