Swift bug in community solutions exercise - The 1st Rule of Poetry Club

Hi.

Need Swift block support attention)
I think in this exercise need some changes in 4. Trim a sentence part.

A lot of people publish wrong solution, they are user full trim spaces, but exercise tell what need only trim end part of string.
At least look at the most popular solution, it misleads people with its logic.

I think need add another one test to check spaces in start of string.

How do you think?

P.s. sorry for my bad English skills, I hope you understand it)

1 Like

Hey @MikeWar1ock

Thanks for posting! I’ve cc’d in @Meatball who might be up for taking a look…

@Meatball - fancy giving this a go in Swift?

Well what I guess is that the “wrong solutions” are using:

str.trimmingCharacters(in: .whitespacesAndNewlines)

I understand what you mean since this method removes all whitespace from both start and end of a string.

I can’t answer for the earlier maintainers of the track or if there are any current maintainers, but I think they just worded the exercise perhaps a bit wierd. Since looking at the examplar so are they using that method I mentioned earlier so do I think that is the intended way to solve it by the author but perhaps the wording should be updated around the exercise.

If that makes sense?

I will look into updating this, but as far as I am aware so do the track not have any maintainers and this would be changes to a concept exercise, so I will have to dig into how this should be handeld.

1 Like