Language: Add StringEx Module
This commit is contained in:
@@ -77,6 +77,7 @@
|
||||
<Compile Include="DataTableEx.vb" />
|
||||
<Compile Include="DateTimeEx.vb" />
|
||||
<Compile Include="InvalidChars.vb" />
|
||||
<Compile Include="StringEx.vb" />
|
||||
<Compile Include="Utils.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
|
||||
9
Modules.Language/StringEx.vb
Normal file
9
Modules.Language/StringEx.vb
Normal 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
|
||||
Reference in New Issue
Block a user