You can convert to List.
For example, if values are in an array, you can convert to List
list = new List<int>(intArray)
or
list = array.ToList
IndexOf returns the index of the value found in a list.
Get Range gets the list of values from the given index and number of elements. GetRange(intIndex, intNumberOfElements)
For Example,
list contains the following values -
Topic 1
Text 1
Text 2
Text 3
Topic 2
Text 1
Text 2
Text 3
Topic 3
I uses Matches activity to get all string that has the word ‘Topic’ at the front
I put the Matches result into a ForEach loop
Thus now if you run the workflow, the item will be - Topic 1, Topic 2, …
Next I uses the Assign activity
I tried to get the Index of each item
When I uses MessageBox to see the result of indexOfTopic1, the result is 0
String indices starts from 0.
So if your string is “Topic 1 something”, and you look for the index of Topic 1, it returns the first character index where it found.
So in this case 0.
I have tried using this solution. I have converted my array into a list. I did get the text between Topic 1 and Topic 2.
However, these codes are static and need to manually change it.
I was thinking of getting all topics into a list and replace the string in the bracket to the list item.
For this Word Document, the number of topics are fixed.
However, if we change to another Word Document, the number of topics may change
I was thinking of getting all topics from this document and then let it get the text from Topic 1 and 2, and then get the text from Topic 2 and 3 dynamically
But I do not know how I can let the program go to Topic 1 and 2, then Topic 2 and 3, and so on.