MS Module Base StringFunctions

Modules.Jibs Sichtbeleg Anpassung
This commit is contained in:
Developer01
2025-03-14 14:43:11 +01:00
parent 3d388362ec
commit 7c473b9a27
6 changed files with 166 additions and 21 deletions

View File

@@ -89,6 +89,7 @@
<Compile Include="FileWatcher\FileWatcherProperties.vb" />
<Compile Include="IDB\Constants.vb" />
<Compile Include="MimeEx.vb" />
<Compile Include="StringFunctions.vb" />
<Compile Include="WindowsEx.vb" />
<Compile Include="ModuleExtensions.vb" />
<Compile Include="FileEx.vb" />

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' indem Sie "*" wie unten gezeigt eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.3.6.0")>
<Assembly: AssemblyFileVersion("1.3.6.0")>
<Assembly: AssemblyVersion("1.3.7.0")>
<Assembly: AssemblyFileVersion("1.3.7.0")>

22
Base/StringFunctions.vb Normal file
View File

@@ -0,0 +1,22 @@
Public Class StringFunctions
Public Shared Function SplitText_Length(ByVal input As String, ByVal maxLength As Integer) As List(Of String)
Dim result As New List(Of String)
For i As Integer = 0 To input.Length - 1 Step maxLength
' Textabschnitt extrahieren
Dim chunk As String = input.Substring(i, Math.Min(maxLength, input.Length - i))
result.Add(chunk)
Next
Return result
End Function
Public Shared Function SplitTextByNewLine(text As String) As List(Of String)
If String.IsNullOrEmpty(text) Then
Return New List(Of String)()
End If
' Zerlege den Text anhand von Zeilenumbrüchen
Dim lines As List(Of String) = text.Split({vbCrLf, vbLf, vbCr}, StringSplitOptions.None).ToList()
Return lines
End Function
End Class