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

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