Hi guys,
How to split String ?
The String format is below
bb/aa
I want to take output
aa
bb
Best Regards;
LwinMoeAung
Hi guys,
How to split String ?
The String format is below
bb/aa
I want to take output
aa
bb
Best Regards;
LwinMoeAung
Buddy,
@Lwin_Moe_Aung
2…Use split string in assign activity like
To get aa
Variable_bb = varibable_1.split(‘/’)(0)
Variable_aa = variable_1.split('/)(1)
Cheers
You can split using the below command
StrVariable.Split("/"c)
This will generate a string array.
Then you can loop through the array using For Each activity.
Let know whether this helps.
If it does, please make sure to mark my answer as the solution too…
Hi … yes… You cave to assign it to an array variable. You are trying assign an array to a string variable. That’s why you are getting the error.
So under the TO segment of the assign activity, clear the text there, and press Ctrl + K to enable variable creation mode, type the variable name there and press enter. THen under variables panel, change the data type of the variable to string array. Under array, select string.
It will work
After Split() you need to specify which string in this string array to be copied to the left variable. For example, if b = ‘1/2’,a = b.Split('/'c)(1),then a=2.
Change the variable as string[ ] and initialize with default value new array[1]
I got it bro…
Thanks you all.
But I have some question that I want to know to get knowledge…
When I tested @Palaniyappan solution I got this error.Why did that happen?
strSeminarMailName.Split("/")(0).ToString
This will work in his code
Buddy @Lwin_Moe_Aung use like
Variablename.split(‘/’)(0).tostring
Or
Try like
Split(variablename,‘/’)(0).Tostring
Either would work buddy
Cheers
Thanks to all for explanation
I got it with this
strSeminarMailName.Split(Convert.ToChar(“/”))(0).ToString.
As @Lahiru.Fernando showed above, you can substitute the shorthand "/"c in place of Convert.ToChar(“/”) inside the Split method. It makes the whole statement a bit shorter and easier to read.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.