Skip to content

Instantly share code, notes, and snippets.

@rabestro
Created March 23, 2024 18:29
Show Gist options
  • Save rabestro/bae0612f7cb132f32832f0a27419e486 to your computer and use it in GitHub Desktop.
Save rabestro/bae0612f7cb132f32832f0a27419e486 to your computer and use it in GitHub Desktop.
Bob. Solution for Power Query M language
(message as text) as text =>
let
yelling = Text.Upper(phrase) = phrase and Text.Lower(phrase) <> phrase,
question = Text.EndsWith(phrase, "?"),
phrase = Text.Trim(message)
in if phrase = "" then
"Fine. Be that way!"
else if yelling and question then
"Calm down, I know what I'm doing!"
else if yelling then
"Whoa, chill out!"
else if question then
"Sure."
else
"Whatever."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment