Start Index cannot be larger than length of string

Hi, I am reading a textfile with UIPath, and wish to extract data after the : sign for each line. This works fine for the five first lines, but at the sixt the robot fails showing the message: “Start index cannot be larger than length of string”

That is pretty logic, but I can’t figure out what to change. I am using an assign activity with this code: data.Split({Environment.NewLine},StringSplitOptions.RemoveEmptyEntries)

I guess the error is in that code, but what???

Issue is not with this code if you are using substring somewhere it is the issue with substring starting index.

OK, so it is in here you mean?

data_arr(5).Substring(data_arr(3).IndexOf(":")+1)

(This is from the step where the debugger shows an error. But it is identical to the other ones that are working fine?)

Hi @wwls,

Can you attach the sample file to do the analysis.

Regards
Balamurugan.S

Thanks for the assistance, problem solved. The problem was in the txt file, not the robot itself.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.