Ad
  • Custom User Avatar

    Hi) , accept " TrimeEnd() "; google in help

  • Custom User Avatar

    No, read the kata's description again:

    Complete the function that accepts a string parameter, and reverses each word in the string. All spaces in the string should be retained.

    "This is an example!" ==> "sihT si na !elpmaxe"
    

    The words keep their relative order, but they should be reversed as how they were originally.

  • Custom User Avatar

    You should return the reversed string, not the original one.

  • Custom User Avatar

    Your code is returning the same string as the input, that's why it fails.

  • Custom User Avatar

    Are you looking at what the input was? Otherwise you can't state that you've reversed them, not knowing the original order.
    You're free to print out information about what's going on in your code. You can print out things like what the input to your method was, and what value your method returns. That way you can manually judge whether your method does what it's supposed to, and whether that agrees with the error report that you're getting.

    It also doesn't matter whether the input is a reversed English word, or a word at all. The input can therefore never be "reversed to begin with" as nothing is supposed to be in any particular order in the input.

  • Custom User Avatar

    "not at all" should obviously be 0, and therefore, "madly" should have the highest value, as you correctly inferred. however, despite your astuteness, you made a miscalculation: being the 6th value of all the possibilities, "madly" should be attributed the numeric value of five (5), two less than you hypothesized