Returns the 1-based index of the first needle found in haystack. If no
needle is found, then 0 is returned.
So, if used directly in the condition of an if statement or loop, the result
will be true if one of the needles is found and false if none are
found, whereas if the result is used elsewhere, it can either be cast to
bool for the same effect or used to get which needle was found first
without having to deal with the tuple that find returns for the
same operation.
Returns the 1-based index of the first needle found in haystack. If no needle is found, then 0 is returned.
So, if used directly in the condition of an if statement or loop, the result will be true if one of the needles is found and false if none are found, whereas if the result is used elsewhere, it can either be cast to bool for the same effect or used to get which needle was found first without having to deal with the tuple that find returns for the same operation.