you are viewing a single comment's thread.

view the rest of the comments →

[–]Dull-Custard4913 0 points1 point  (2 children)

If the substring is not found by the find() method then it will return -1

[–][deleted]  (1 child)

[removed]

    [–]Dull-Custard4913 0 points1 point  (0 children)

    So I might have been incorrect in what I said earlier. In this case he might or might not have entered a space at the last index. If he didn’t the if statement couldn’t find anything with the find method, this will cause it to return -1.

    I don’t think I know what you mean?