Rubberduck.Parsing.VBA.StringExtensions.HasComment C# (CSharp) Method

HasComment() public static method

Returns a value indicating whether line of code is/contains a comment.
public static HasComment ( this line, int &index ) : bool
line this The extended string.
index int The start index of the comment string.
return bool
        public static bool HasComment(this string line, out int index)
        {
            var instruction = line.StripStringLiterals();

            index = instruction.IndexOf(Tokens.CommentMarker, StringComparison.InvariantCulture);
            if (index >= 0)
            {
                return true;
            }

            index = instruction.IndexOf(Tokens.Rem + " ", StringComparison.InvariantCulture);
            return index >= 0;
        }