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("/","-")
Hi @mz3bel
Assign a datetime var=strvar.toString(dd-mm-yyyy)
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.
Yes @ranjith
I try to get only date
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
No need for regex the replace code works fine. Thank you
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)