c.GetLastInstanceOf

PHOTO EMBED

Mon Nov 08 2021 16:32:26 GMT+0000 (Coordinated Universal Time)

Saved by @rick_m #c#

public static string GetLastInstanceOf(string sentence)
        {
            string returnValue = sentence;

            var matches = System.Text.RegularExpressions.Regex.Matches(sentence, @"\(([^)]*)\)");
            if (matches.Count > 0)
            {
                returnValue = matches.Last().Groups[1].Value;
            }

            return returnValue;

        }
content_copyCOPY