Ad
  • Custom User Avatar

    Your if sentence is wrong, change to:

    if s == ("") || s == (nil)
    

    EDIT: Brackets are not necessary.

  • Custom User Avatar

    The error means nil has no a method split, I think perhaps you want use split with a string value, but your code generate some invalid value(nil) , and then call split, and then post the error. isn't it?

    EDIT: I've read the description, it said:

    you should validate that the given string is not empty or null. If so, the method should return:
    "Invalid String!"

    If you forgot to validate the type of the argument?

  • Custom User Avatar

    A small suggestion is you should tell author that you are using which language ;-)