I am using split StrSting= StartString.Trim.Split("-"c)(1).
if value of StrString=“Approved (crawqa - May 14, 2019)” bot is working correct.
if value of StrString= “Previous Assignment To Jon Ansah XactOnline Support (Crawford & Co.) On Oct 4, 2018”
It is showing error= Index was outside the bounds of array source in Assign.
Check that the string contains “-” before splitting. The second example is failing because it doesn’t have a hyphen character so the Split returns an array with only one item. So the index 1 is out of bounds.
You need to check that the String contains “-”. Use an If and for the condition do StrString.Contains(“-”). Then if true you can split and do your normal logic. If false you need to process the string differently.
Before dividing into String using split function first check whether the string contains “-” or not. If it contains then split it based in “-” else don’t split it.
Hi i have same problem but,
There is a text I’m splitting it when it has 2 index’s but, sometime only 1 index is available then it throws Index was outside the bounds of the array.
for Example strExample=“Hospital Name 1-203659045”
I need to Split this and update into different columns
Please help me when it doesn’t have phone number need to ignore the phone number column