Base: migrate functions from other modules, add new functions
This commit is contained in:
@@ -21,6 +21,11 @@ Public Class StringEx
|
||||
If Char.IsLetterOrDigit(oChar) Then
|
||||
oBuilder.Append(Char.ToLower(oChar))
|
||||
oWasHyphen = False
|
||||
|
||||
ElseIf oChar = "_"c Or oChar = "-"c Then
|
||||
oBuilder.Append(oChar)
|
||||
oWasHyphen = True
|
||||
|
||||
ElseIf Char.IsWhiteSpace(oChar) AndAlso Not oWasHyphen Then
|
||||
oBuilder.Append("-"c)
|
||||
oWasHyphen = True
|
||||
@@ -111,6 +116,22 @@ Public Class StringEx
|
||||
Return GetChecksum(pStringToCheck).Substring(0, 32)
|
||||
End Function
|
||||
|
||||
Public Shared Function GetDateString() As String
|
||||
Return $"{Now:yyyy\\MM\\dd}"
|
||||
End Function
|
||||
|
||||
Public Shared Function GetDateString(pDate As Date) As String
|
||||
Return $"{pDate:yyyy\\MM\\dd}"
|
||||
End Function
|
||||
|
||||
Public Shared Function GetDateTimeString() As String
|
||||
Return $"{Now:yyyy-MM-dd_hh-mm-ffff}"
|
||||
End Function
|
||||
|
||||
Public Shared Function GetDateTimeString(pDate As Date) As String
|
||||
Return $"{pDate:yyyy-MM-dd_hh-mm-ffff}"
|
||||
End Function
|
||||
|
||||
Friend Class InvalidChars
|
||||
Public Shared Filenames As String = Regex.Escape(New String(IO.Path.GetInvalidFileNameChars()))
|
||||
Public Shared Paths As String = Regex.Escape(New String(IO.Path.GetInvalidPathChars()))
|
||||
|
||||
Reference in New Issue
Block a user