10 lines
323 B
VB.net
10 lines
323 B
VB.net
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
|