Strips comments from a SQL query.Namespace: CleanCode.Data
Assembly: CleanCode (in CleanCode.dll) Version: 126.96.36.199 (1.2.03)
public string StripCommentsFromQuery( string query )
Public Function StripCommentsFromQuery ( _ query As String _ ) As String
public: String^ StripCommentsFromQuery( String^ query )
- Type: System String
Return ValueA cleaned up query.
First, all block comments are stripped, delineated by BlockCommentStartMark and BlockCommentEndMark tokens. Next, all end-of-line comments are stripped, delineated by EndOfLineCommentMark and the end of its containing line. Finally, all multiple occurrences of line endings are replaced by a single newline character. Note, however, that this routine honors one special convention to allow you to force some end-of-line comments to remain. Simply use a double-occurrence of the EndOfLineCommentMark token on those comments.