AvalonStudio.Languages.CSharp.IndentationReformatter.TrimEnd C# (CSharp) Method

TrimEnd() private static method

private static TrimEnd ( IDocumentAccessor doc ) : bool
doc IDocumentAccessor
return bool
        private static bool TrimEnd(IDocumentAccessor doc)
        {
            var line = doc.Text;
            if (!char.IsWhiteSpace(line[line.Length - 1])) return false;

            // one space after an empty comment is allowed
            if (line.EndsWith("// ", StringComparison.Ordinal) || line.EndsWith("* ", StringComparison.Ordinal))
                return false;

            doc.Text = line.TrimEnd();
            return true;
        }