Strips comments from a SQL query.
Namespace: CleanCode.DataAssembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
public string StripCommentsFromQuery(
string query
)
Public Function StripCommentsFromQuery ( _
query As String _
) As String
Public Function StripCommentsFromQuery ( _
query As String _
) As String
public:
String^ StripCommentsFromQuery(
String^ query
)
Return Value
A 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.