0

I'm working with Twilio Studio trying to get the first word from an SMS text message. The issue is that sometimes the word has a : or ; appended.

Example: TEST: This is a test

I need the TEST alone, without the :.

I tried the truncatewords filter, but TEST: was still returned.

{{trigger.message.Body | split: " " | first | truncatewords: 1 | downcase}}

How is this done?

SeaDude
  • 3,725
  • 6
  • 31
  • 68

1 Answers1

2

Looks like I'd just perform another split like:

{{trigger.message.Body | split: " " | first | split: ":" | first | downcase}}

SeaDude
  • 3,725
  • 6
  • 31
  • 68