diff --git a/Language/StringEx.vb b/Language/StringEx.vb index a4cb6f4d..2fcfa2b1 100644 --- a/Language/StringEx.vb +++ b/Language/StringEx.vb @@ -12,4 +12,15 @@ Public Module StringEx If String.IsNullOrEmpty(pString) Then Return pString Return pString.Substring(0, Math.Min(pLength, pString.Length)) End Function + + ''' + ''' Replaces single quotes in text for SQL Commands. + ''' + ''' The string + ''' The escaped string. + + Public Function EscapeForSQL(pString As String) As String + If String.IsNullOrEmpty(pString) Then Return pString + Return pString.Replace("'", "''") + End Function End Module