Ad
  • Custom User Avatar

    I think the description is still not clear. We assumed that by "trailing whitespaces" they mean only the spaces because technically a newline character is ALSO a white space character, but this one we have to keep.
    They should be more thorough about which characters they want to keep and which ones they want to strip.

  • Custom User Avatar

    \t is a whitespace and after removing the comment is at the end of the line.

    For:

                     v                
    Test: String: "\t@ - apples\napples , @\nbananas cherries ! ' =\npears strawberries\ncherries avocados ' lemons" Markers: ['!', '-', '?', '=', '@', '#', '.']`
    
    

    First you remove the comments, then, you check for trailing whitespaces and remove them:

    "\t@ - apples\n" // first line before removing the comment
    "\t\n"           // first line after removing the comment
    "\n"             // first line after removing the trailing whitespaces
    
  • Custom User Avatar

    You should remove it only if it is at the end of the line:

    Any whitespace at the end of the line should also be stripped out.

  • Custom User Avatar