Language: Add StringEx Module

This commit is contained in:
Jonathan Jenne
2022-08-04 13:28:45 +02:00
parent ce3b3a5ba8
commit 69d56d12e3
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
Imports System.Runtime.CompilerServices
Public Module StringEx
<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