Today's challenge requires you to write a function which removes all question marks from a given string.
For example:
hello?would behello
This challenge comes from aikedaa here on DEV.
Want to propose a challenge idea for a future post? Email yo+challenge@dev.to with your suggestions!
Latest comments (41)
Python
My solution in js
As simple as it sounds, in python :
I see. Also
%literal is my favorite string literal :)I love weird Ruby syntaxπ
TIPS:
??is known as character literal notationdocs.ruby-lang.org/en/trunk/syntax...
Perl solution:
The
troperator works like thetrshell util./dmeans non-replaced characters are deleted,/rreturns the value instead of modifying the bound variable.Python:
`
And to use it:
ENTERPRISE
NOOOO!!!
You need to create an instance of the
OpinionAboutJavaFactory! You can just have a staticgetOpinionAboutJavamethod! Now your code is not SOLID!I intentionally avoided using
sedthis time, wanted to implement it with "pure" Bash. Usingsedthe implementation, of course, becomes much shorter.