yannip
October 30, 2018, 8:34am
1
Hi;
A“split” question:
I need to split the following “2010 - trmlo202010 - 21 - 23” and the output should be “trmlo202010 - 21 - 23”. If i split on “-” with index 1, I only get the ‘trmlo202010’ part. Also it is variable, I know there will be at least 1 “-” and I need to get the string after this first “-”.
Few examples:
Input “2010 - trmlo202010 - 21 - 23” with expected output “trmlo202010 - 21 - 23”
Input “2020 - AbCD202010 - 22 -24 - 27 - 23" with expected output “AbCD202010 - 22 -24 - 27 - 23”
Thanks
rkelchuri
(ER.Krishna)
October 30, 2018, 8:42am
2
try this:
String1 = “2010 - trmlo202010 - 21 - 23”
String2 = Left(String1,4)
This will give flexibility on separator value what ever the year it is in the beginning of the string.
Hope my inputs are useful.
yannip
October 30, 2018, 8:47am
3
Thanks, seems usefull. However, I can not find the activity. Which package is this?
Topi
(Topi Asikainen)
October 30, 2018, 8:55am
7
Hi,
other solution would be to limit the number split occurences:
inputStr.Split({“-”}, 2, Nothing).Last.ToString
Will split on only the first occurence of “-” and return the second part (.Last) as a string.
br,
Topi
1 Like
system
(system)
Closed
October 31, 2018, 9:12am
9
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.