Hi all,
I’m trying to extract the numbers from a string such as this;
Smith, Shannon (123456789)
These will be dynamic, but I’ve also practiced using static values. This is all inside a for each loop, iterating through a string.
So far I’m using an activity to assign a value for the index of the first bracket;
Assign
index ← item.IndexOf(“(”)
Using the example above, index is now 15
I want to substring from the bracket to the end minus 2 (there’s also a space), so I have an activity saying
item = item.Substring(index, item.Length-2);
This crashes with the error Index and length must refer to a location within the string with a Parameter name length
Looking at the variables, the item length is 27, so I’m unsure why index (15) and item.Length-2 (25) doesn’t work.
Also I’ve tried, for testing purposes, so create a new variable called itemTest. I have;
Assign
itemTest = item.Substring(0,5)
Once this runs, itemTest completely disappears from my variables table.
Does anyone have any idea of what I’m doing wrong? All I want is to take this string;
Smith, Shannon (123456789)
and return
123456789




