Skip to main content
added 590 characters in body
Source Link
l4m2
  • 28.5k
  • 2
  • 25
  • 103

JavaScript (Node.js), 135 bytes

x=>!!x&&(t="Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c>' '?/^(.)\1/i.test(c+x)?(x=x.slice(1).trim(),c):'-':c),!x&&t)

Try it online!

If "may" mean either do or not do is okay, then

JavaScript (Node.js), 106 bytes

x=>x&&(t="Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c==x[0]?(x=x.slice(1),c):'-'),!x&&t)

Try it online!

JavaScript (Node.js), 135 bytes

x=>!!x&&(t="Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c>' '?/^(.)\1/i.test(c+x)?(x=x.slice(1).trim(),c):'-':c),!x&&t)

Try it online!

JavaScript (Node.js), 135 bytes

x=>!!x&&(t="Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c>' '?/^(.)\1/i.test(c+x)?(x=x.slice(1).trim(),c):'-':c),!x&&t)

Try it online!

If "may" mean either do or not do is okay, then

JavaScript (Node.js), 106 bytes

x=>x&&(t="Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c==x[0]?(x=x.slice(1),c):'-'),!x&&t)

Try it online!

Source Link
l4m2
  • 28.5k
  • 2
  • 25
  • 103

JavaScript (Node.js), 135 bytes

x=>!!x&&(t="Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c>' '?/^(.)\1/i.test(c+x)?(x=x.slice(1).trim(),c):'-':c),!x&&t)

Try it online!