Ad
  • Custom User Avatar

    Thank you! Totally lost until learning about non-breaking spaces. Using the character code did it.

  • Custom User Avatar

    The kata are considered not exact duplicates.

  • Custom User Avatar

    This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/131.
    Please join the discussion to help us identify duplicate kata and retire them.

  • Custom User Avatar

    If you need a non-breaking space ("break space") you can scroll to the bottom of sample tests and use the red dot, or use character code 65279.

    "A commonly used entity in HTML is the non-breaking space. A non-breaking space is a space that will not break into a new line. Two words separated by a non-breaking space will stick together (not break into a new line)." - W3 Schools

  • Default User Avatar

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

  • Default User Avatar

    what is the non-whitespace? i cant get it (

  • Custom User Avatar

    split(" ") --> need a space " ", if closed "" will break down everything into a single character not whole word example: "hello world".split(" ") --> ['hello', 'world' ] "hello world.split("") --> [
    'h', 'e', 'l', 'l',
    'o', ' ', 'w', 'o',
    'r', 'l', 'd'
    ]

    hint: join() is not needed to solve this but doesn't mean your approah is wrongs and might need it to get rid of spaces...(haven't ran code but seems you're getting rid of spaces with loop)

    Sooo...
    with join() the default will join every thing with a "," inbetween example H,e,l,l,o,'',W,o,r,l,d

    with no space chosen ("") as how to join the split "hello world".split(" ").join("") --> HelloWorld as one word

    with space chosen (" ") as how to join the split "hello world".split(" ").join(" ") --> hello world

    *Note that "hello world".split("").join("") will return the same becasue of the space when split into single characters
    *BUT! with this you need to split into seperate words so..

    "what (3 spaces) ever sentence".split(" ")
    (put (3 spaces) to represent becasue when submitted this reply it took away spaces! ugh!)
    --> will split all the whole words and spaces into thier own index like [ 'what', '', '', 'ever', 'sentence' ] and join(" ") with a space inbetween ..."what ever sentence"...join("") --> "whateversentence"

    hope this helps refactor easier :)

  • Default User Avatar

    Worst kata ever.

  • Custom User Avatar

    what are space-like characters?

  • Default User Avatar

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

  • Default User Avatar

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

  • Custom User Avatar

    You're well-educated to tell it

  • Custom User Avatar

    "I'm looking so cool today"

    Expected: 5, instead got: 6

    1)I
    2)m (short form from "am")
    3)looking
    4)so
    5)cool
    6)today

  • Custom User Avatar

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

  • Default User Avatar

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

  • Loading more items...