Base Module: Extension Methods ergänzt

This commit is contained in:
PitzM 2024-02-02 10:08:00 +01:00
parent 180642bfb9
commit cf2e2161cf

View File

@ -65,6 +65,30 @@ Public Module ModuleExtensions
Return (pString.Trim().ToLower() = "true") OrElse (pString.Trim() = "1")
End Function
''' <summary>
''' Checks if a string is null or empty
''' </summary>
''' <param name="pString">The input string</param>
''' <returns>True string is null or empty, otherwise false.</returns>
<Extension()>
Public Function IsNullOrEmpty(pString As String) As Boolean
Return String.IsNullOrEmpty(pString)
End Function
''' <summary>
''' Checks if a string is NOT null or empty
''' </summary>
''' <param name="pString">The input string</param>
''' <returns>True string is null or empty, otherwise false.</returns>
<Extension()>
Public Function IsNotNullOrEmpty(pString As String) As Boolean
If String.IsNullOrEmpty(pString) Then
Return False
Else
Return True
End If
End Function
' ======================================================
' === DICTIONARY
' ======================================================