Laufzettel; EZABestätigung, Kafka, CBAM, KVI Report
This commit is contained in:
@@ -43,6 +43,54 @@ Public Class cProgramFunctions
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function ExpandNumbers(input As String) As String
|
||||
If String.IsNullOrWhiteSpace(input) Then Return ""
|
||||
|
||||
Dim result As New HashSet(Of Integer)
|
||||
|
||||
Dim parts = input.Split(","c)
|
||||
|
||||
For Each part In parts
|
||||
Dim p = part.Trim()
|
||||
|
||||
If p.Contains("-") Then
|
||||
' Range z.B. 8-10
|
||||
Dim r = p.Split("-"c)
|
||||
If r.Length = 2 Then
|
||||
Dim startVal, endVal As Integer
|
||||
If Integer.TryParse(r(0), startVal) AndAlso Integer.TryParse(r(1), endVal) Then
|
||||
For i = startVal To endVal
|
||||
result.Add(i)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
ElseIf p.Contains("+") OrElse p.Contains("&") Then
|
||||
' Mehrere Werte z.B. 5+7 oder 2&10
|
||||
Dim separators() As Char = {"+"c, "&"c}
|
||||
Dim nums = p.Split(separators, StringSplitOptions.RemoveEmptyEntries)
|
||||
|
||||
For Each Numb In nums
|
||||
Dim val As Integer
|
||||
If Integer.TryParse(Numb.Trim(), val) Then
|
||||
result.Add(val)
|
||||
End If
|
||||
Next
|
||||
|
||||
Else
|
||||
' Einzelwert
|
||||
Dim val As Integer
|
||||
If Integer.TryParse(p, val) Then
|
||||
result.Add(val)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
' Sortiert zurückgeben
|
||||
Return String.Join(",", result.OrderBy(Function(x) x))
|
||||
|
||||
End Function
|
||||
Public Shared Function printdefaultOutlookAccount(outlookApp As Outlook.Application) As String
|
||||
|
||||
' Get the MAPI namespace
|
||||
|
||||
Reference in New Issue
Block a user