Binboo.Core.Application.CommandsFor C# (CSharp) Method

CommandsFor() public static method

public static CommandsFor ( string message ) : IEnumerable
message string
return IEnumerable
        public static IEnumerable<string> CommandsFor(string message)
        {
            message = message.StripPluginName();

            int startPos = 0;
            int currentPos;

            for (int pos = message.IndexOf('|'); pos != -1; pos = message.IndexOf('|', currentPos) )
            {
                if (!InsideQuotedText(message, pos, startPos))
                {
                    yield return message.Substring(startPos, pos - startPos - 1).Trim();
                    startPos = pos + 1;
                }

                currentPos = pos + 1;
            }

            yield return message.Substring(startPos).Trim();
        }