How to Split Date from Text

Hi This is my String - “Tue Sep 04 15:00:00 CEST 2022”

from this string I need to Separate the Date like this - Sep 04 2022
How can we split this String ?
Can Anyone please help on this

Thank You in Advance

Hi @kaveri_satpute - Try the below one

Variable of type String Output = System.Text.RegularExpressions.Regex.Match(InputString,"\D{3}\s+\d{2}\s+\d{2}\:\d{2}\:\d{2}").ToString

Ref workflow - Example.zip (3.0 KB)

Capture

Thank you for the Solution

Is there any other solution this is bit difficult to understand

Hi @kaveri_satpute

Check out the XAML file

GetDateString.xaml (5.9 KB)

Output

image

Regards
Gokul

Hi,

How about the following?
Split the string by whitespace, and join necessary part.

arrStr = yourString.Split(" "c)

Then

String.Join(" ",{arrStr(1),arrStr(2),arrStr(5)})

Regards,

@kaveri_satpute You can use string operations

Variable of type Arr of strings output = InputString.Split({" "}, StringSplitOptions.None).ToArray

Output

Capture

Ref workflow - Example.zip (3.0 KB)

@kaveri_satpute
Try split string

Split("Tue Sep 04 15:00:00 CEST 2022"," ")

image

image

Thank you for the Solution
Easy to understand