Binboo.Core.Util.MessageExtensions.PluginName C# (CSharp) Method

PluginName() public static method

public static PluginName ( this message ) : string
message this
return string
        public static string PluginName(this string message)
        {
            var pluginMatch = Regex.Match(message, @"\$(?<pluginName>[a-zA-Z]+)\s*");
            if (!pluginMatch.Success)
            {
                throw new ArgumentException(string.Format("Missing plugin name in message '{0}'", message), "message");
            }

            return pluginMatch.Groups["pluginName"].Value;
        }