Hello guys, i have a question about "if" in one line. the idea of the function is to return the value if the sentence has or not characters. Because in if like this it works.
This is fine, but a simple return !length(s); is preferred.
The syntax you're looking for is return (length(s) != 0)? false: true;
However, in a boolean context, testing against 0 is redundant: return length(s)? false: true;
And you might as well just return the result of the test: return !length(s);