Ad
  • Custom User Avatar

    1 is not obvious. It's pointless.
    There's no real-world application to testing whether a string ends in a blank string.

    ANY string could be considered to 'end' in a blank string because adding a blank string to any string leaves it unchanged.
    For that matter, we could say that any string begins, ends, and has infinite blank strings between every element across its length!

    So why not test for and count all of them?
    Pointless.

  • Custom User Avatar

    I agree. That's a silly test case.
    Any and all strings could be considered to 'end' with a blank string.
    That's because adding a blank string to any other string leaves it unchanged.
    So why test for it?
    Completely useless in any real-world application.

  • Custom User Avatar

    I agree. How can you say it's true that any string with a length greater than 0 is 'ended' by a string of no length?

    It may be true that if you concatenated a string of no length to the end of any non-blank string, that the non-blank string would be unchanged and therefore 'equal'.
    But that's not the same thing as asking if the non-blank string "ends" in the blank string...

    If you agree that it's true, then you must also agree that ANY string (including a blank string) is 'ended' by a blank string.
    And in that case, there's no point in testing for it!