Language: Add String truncate
This commit is contained in:
parent
735332ed3e
commit
19424e6adf
@ -1,6 +1,12 @@
|
|||||||
Imports System.Runtime.CompilerServices
|
Imports System.Runtime.CompilerServices
|
||||||
|
|
||||||
Public Module StringEx
|
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()>
|
<Extension()>
|
||||||
Public Function Truncate(pString As String, pLength As Integer) As String
|
Public Function Truncate(pString As String, pLength As Integer) As String
|
||||||
If String.IsNullOrEmpty(pString) Then Return pString
|
If String.IsNullOrEmpty(pString) Then Return pString
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user