MONSTER: Rename Monorepo to Modules, only keep Projects under Modules.*
This commit is contained in:
15
Language/StringEx.vb
Normal file
15
Language/StringEx.vb
Normal file
@@ -0,0 +1,15 @@
|
||||
Imports System.Runtime.CompilerServices
|
||||
|
||||
Public Module StringEx
|
||||
''' <summary>
|
||||
''' Truncates a string to the specified length if it exceeds that length.
|
||||
''' </summary>
|
||||
''' <param name="pString">The string</param>
|
||||
''' <param name="pLength">The maximum string length</param>
|
||||
''' <returns>The truncated string</returns>
|
||||
<Extension()>
|
||||
Public Function Truncate(pString As String, pLength As Integer) As String
|
||||
If String.IsNullOrEmpty(pString) Then Return pString
|
||||
Return pString.Substring(0, Math.Min(pLength, pString.Length))
|
||||
End Function
|
||||
End Module
|
||||
Reference in New Issue
Block a user