Skip to content

StringBuilder should be used in CsQuery.HtmlParser.ExtensionMethods #24

Closed
@matt-psaltis

Description

@matt-psaltis

There's other ways of achieving this but in keeping with the existing method format...
The existing result += text[i]; kills performance when parsing larger html blocks.

    public static string SubstringBetween(this char[] text, int startIndex, int endIndex)
    {
        var result = new StringBuilder();
        for (var i = startIndex; i < endIndex; i++)
        {
            result.Append(text[i]);
        }
        return result.ToString();
    }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions