Hi,
I am trying to split string using sub string where my word data looks like
Summary : Summary of the Issue
Description : Description of the Issue
Step 1: I am replacing each new line with ‘$’ symbol so that each line in the word could get into single line and stored in a variable “Word Data”
After replacing the WordData variable contains
Summary : Summary of the Issue$Description : Description of the Issue$Priority : High$Environment : UAT$$$$
Step 2 : I am splitting the word array with its sub string
WordData.Split(“Description :”)(0).Split(“Summary :”)(1).Trim()
I am expecting the above code should bring the value “Summary of the Issue” . but the actual is below
Could someone help me out to clear this error!!
HareeshMR
(Hareesh Madasi)
March 3, 2020, 12:28pm
2
Hi @Kirubakaran_Kannan ,
Split only accepts characters to split the entire string but not the entire strings which you provide.
Split(“Summary”)(1) Instead of this, it will work as .Split(":"c)(1)
1 Like
prakaz25
(Prakash M)
March 3, 2020, 12:30pm
3
Hi @Kirubakaran_Kannan
Check with below format:
StringVaraible.Split({“Description:”},StringSplitOptions.None)
3 Likes
Nithin_P
(Nithin Prabhu)
March 3, 2020, 12:30pm
4
Hello @Kirubakaran_Kannan ,
Use the other Split function instead, should work as expected:
Regards,
Nithin Prabhu
3 Likes
Hi Nithin, that’s a great solution. however i tried and getting the below array bound error. Couldyou please check
Assign: Index was outside the bounds of the array.
Still getting the same error dude here is the sequence for your reference.
UiDemo_Login - Imported.xaml (5.3 KB)
Nithin_P
(Nithin Prabhu)
March 4, 2020, 4:27am
9
I think you missed the change in index on the second split. A snap from your workflow with the changes highlighted (Your workflow was still pointing to Index 1):
Regards,
Nithin
1 Like
Hi @HareeshMR
I would require to store multiple values like this, all the value has “:” as delimiter. So i cannot go with this. Suggest me if you have any other solution
Actually im getting the output “Summary : Summary of the issue” .
but i need the value of the label which is only the “Summary of the issue” not the label.
UiDemo_Login - Imported.xaml (5.5 KB)
can you just try from yourside with my values kept in a word file
Summary : Summary of the Issue
Description : Description of the Issue
Nithin_P
(Nithin Prabhu)
March 4, 2020, 4:50am
12
Considering scalability of the solution. I have switched to regex instead of split function. Check this out
Regex_Label_Field.zip (22.2 KB)
Regards,
Nithin
1 Like
system
(system)
Closed
March 7, 2020, 4:50am
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.