Terrarium.PeerToPeer.NetworkEngine.GetValuesFromContent C# (CSharp) Method

GetValuesFromContent() public static method

Retrieves a collection of values delimited by tags from content. Doesn't confirm that the file is valid XML.
public static GetValuesFromContent ( string startTag, string endTag, string content ) : ArrayList
startTag string The start tag.
endTag string The end tag.
content string The content to parse.
return System.Collections.ArrayList
        public static ArrayList GetValuesFromContent(string startTag, string endTag, string content)
        {
            var items = new ArrayList();

            var startIndex = content.IndexOf(startTag);
            while (startIndex > -1)
            {
                var lastIndex = startIndex + startTag.Length;
                var endIndex = content.IndexOf(endTag, lastIndex, content.Length - lastIndex);
                if (endIndex > -1)
                {
                    items.Add(content.Substring(lastIndex, endIndex - lastIndex));
                }

                startIndex = content.IndexOf(startTag, lastIndex, content.Length - lastIndex);
            }

            return items;
        }