Quantcast
Channel: string.find() returns true when ==-1 is used but false when
Browsing all 3 articles
Browse latest View live

Answer by songyuanyao for string.find() returns true when ==-1 is used but...

My understanding is that string::find(char c) returns -1 when it is not found.It's not accurate. According to the documentation:Return value Position of the first character of the found substring or...

View Article



Answer by user3196144 for string.find() returns true when ==-1 is used but...

string::find() returns size_t, which is an unsigned int so it can never be negative.

View Article

string.find() returns true when ==-1 is used but false when

I am trying to find a character within a string but I am getting unexpected results. My understanding is that string::find(char c) returns -1 when it is not found. However, I am getting some unexpected...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images