Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 11
    \$\begingroup\$ It's too bad that the ban on andAND letters in code means a lot of language constructs just aren't allowed, making a regex-based method even more tempting. And Python can't print, return, or lambda, and so needs some imagination to even output anything. \$\endgroup\$ Commented Jul 23, 2020 at 10:33
  • 1
    \$\begingroup\$ @xnor Good point. I just felt that without the restriction I'd only see the basic replace (?i)\band\b with and $0 and $0 and for language with regex, and felt it needed something enforcing people to be a bit more creative with their answers, hence the restricted-source. I also realize this is just a flaw in my base challenge, since do-X-without-Y challenges are usually discouraged, but I felt without it the challenge would be too boring. Out of curiosity: what would you have changed to still have the base challenge, but without only seeing the to-the-point regex-replace approach? \$\endgroup\$ Commented Jul 23, 2020 at 12:07
  • 1
    \$\begingroup\$ @Shaggy Due to the amount of answers already I'd say no, sorry. It indeed doesn't add much to split on spaces at the start and join by spaces at the end. But considering the answers that would need some changes, and since I mentioned only letters and spaces are valid input-characters, I think it's best to leave it as is now. But if you have convincing arguments otherwise, lmk please. \$\endgroup\$ Commented Jul 23, 2020 at 15:26
  • 3
    \$\begingroup\$ @KevinCruijssen I don't have any good ideas for dealing with regex being too good. Honestly, I often avoid writing string-manipulation challenges because of this. \$\endgroup\$ Commented Jul 23, 2020 at 21:56
  • 3
    \$\begingroup\$ @AdHocGarfHunter Heh, I didn't mean to hype it as interesting, was just saying the obvious things aren't allowed. \$\endgroup\$ Commented Jul 24, 2020 at 1:08