I want to separate values based on line breaks

Data stored in one variables:

2024-04-15(mon)
08
h
00
m
~ 2024-04-16(tue)
08
h
00
m

From the data stored in this way
2024-04-15, 08, 00, 2024-04-16, 08, 00
I want to extract only this data and store it in each variable, but I don’t know how to separate it.

ASCII char(13) + char(10),You can try it, this is the normal line break symbol “\ r \ n”

drag find matching pattern activity
use this regular expression \b\d{4}-\d{2}-\d{2}\b

Using this you will only get “2024-04-15”

1 Like

Hey,

You can use this query:
System.Text.RegularExpressions.Regex.Matches(str_Input,“\b\d{4}-\d{2}-\d{2}\b|\d{2}”).Select(Function(x) x.ToString).ToArray

The output of the above query will give a Array of String.

Cheers!

Hi @Benimaru

inputString = "2024-04-15(mon)
               08
               h
               00
               m
               ~ 2024-04-16(tue)
               08
               h
               00
               m"

outputString = String.Join(", ", System.Text.RegularExpressions.Regex.Matches(inputString,"\d{4}-\d{2}-\d{2}|\d{2}"))

Hope it helps!!