Hello,
How can i split this data
7100 / 29 to 7100 and 29 and split date
17/06/2019 00:01:35 to split date from time
PS: data from excel file
Thank you
Hello,
How can i split this data
7100 / 29 to 7100 and 29 and split date
17/06/2019 00:01:35 to split date from time
PS: data from excel file
Thank you
You can use replace function to replace “/” with “-” .
In Assign Activity
your_String= your_String.replace("/","-")
Ok, thank you
Hi @AshwinS2
You Sure this Query will work have a doubt on it Though. Did you try testing it.
Yea you’re right , the expression tries to assign a string value to date and also .tostring(dd-mm-yyyy) is not a function of string object.
Hi @mz3bel
"7100 / 29 “.split(”/"c)(0) will give you 7100
"7100 / 29 “.split(”/"c)(1) will give you 29
cdate(“17/06/2019 00:01:35”).tostring(“dd/mm/yyyy”)
Try
string_output = system.Text.RegularExpressions.Regex.Match(your_String.replace("/","-"),"\b\d{1,2}-\d{1,2}-\d{4}\b").value
the two first lines gives me this error
19.5.0+Branch.master.Sha.a03bc4726ca82b7bb3addb0d04106dc150b31fba
Source: Assign
Message: Object reference not set to an instance of an object.
Exception Type: System.NullReferenceException
As i think they don’t get a value…
for date i don’t unterstand what you mean?
Vardate(“17/06/2019 00:01:35”).tostring(“dd/mm/yyyy”) ? which by the way already a string
Up Up people
Ah my mistake didn’t know about “CDate”
Anyway it tells me that there that they can’t convert string to date.
Because, i get the data from an excel file, than convert it to string…
So i figured out how to do it, of course with some help xD
Solution :
row.Item(1).ToString.Split("/"c)(0)
row.Item(3).ToString.TrimStart(" “c).Split(” "c)(0)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.