How best to obtain NFL Name from String

Hello, what is best approach for me to capture just the NFL name from this string?
“New England Patriots 2021-2022”

What I need is this: “New England Patriots”

Thanks

this sample would work with the following regex:
grafik

Probably you need more samples when the values will not be strict within this pattern

Hello @DARREN_THOMPSON ,

You can do as below to fetch the required value.

System.Text.RegularExpressions.Regex.Match(inputText, ([A-Z])\w+").ToString

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.