• Custom User Avatar

    No.
    If either argument is greater than stringName.length, it is treated as if it were stringName.length.

    EDIT: Just ignore that. I thought you were talking about JS not Java xD.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The writer of the kata explicitly said not to use encode. You really should not have used it.

  • Custom User Avatar

    8 kyu kata are supposed to be for complete beginners. The replace method isn't taught to beginners.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I am not 100% sure because of the spacing, but I think that if you set "a" to "len(x)" then "a > len(x)" will always be false. This means that your code will be returning the length of the last word as the if statement will never be evaluated.