ShaderInterpreter.Converter.FindBOL C# (CSharp) Method

FindBOL() private static method

/// Inserts a snippet of text at a specific index in the source /// Finds the index of the beginning of the current line
private static FindBOL ( string _Source, int _StartIndex ) : int
_Source string
_StartIndex int
return int
        private static int FindBOL( string _Source, int _StartIndex )
        {
            int	MatchIndex = _Source.LastIndexOf( '\n', Math.Max( 0, _StartIndex-1) );
            return MatchIndex != -1 ? MatchIndex+1 : 0;	// BOF?
        }