I know that you could split the date and verify count of characters but I was wondering if there is a wildcard or such, that you could define in the convertion in stead.
You can use a wildcard-style format in ParseExact by handling multiple possible date formats using DateTime.TryParseExact or by defining several formats. You can try something like this:
formats = {“d-M-yyyy”, “dd-MM-yyyy”, “d-MM-yyyy”}
If DateTime.TryParseExact(dateStr, formats, New System.Globalization.CultureInfo(“da-DK”), System.Globalization.DateTimeStyles.None, result) Then
Console.WriteLine(result.ToString(“dd-MM-yyyy”))
You can use ParseExact function in an Assign activty. Also if you want to use TryParseExact function, it must be in the if condition because it returns a boolean value