Assign: startIndex cannot be larger than length of string. Parameter name: startIndex1

pls solve this bug

Hi @raja_ias,

Could you please provide some context to your issue, and a screenshot of where the issue occurs? What are you doing to get this error?

Hi @raja_ias

Are you using any string methods like substring,remove,index ofetc.

if yes then the index you are providing is larger than the length of the string as the error says/

ex: if string is test (its length is 4)
then you are giving a index of more than 4


1 Like

ind is my initial position
last is my last position

@raja_ias Could you check what is the length of the outp, what is the value of the variables ind and last by using message box.


I checked @prasath_S ind=175 and last=618.
still same error

@raja_ias what is the length of outp?

@prasath_S 618 bro

Did you get the error while assigning substring?

if yes could you get the length of the outp before that using message box.

i can see you are assigning outp to string.format, did you take length before or afte that?


yes, I get errors while assigning substrings…
I take length after string.format

i found the answer…can u explain how I apply?

sorry iI couldn’t understand, did the error solved?


no @prasath_S …But I found the answer on the uipath forum. But IDK how to use it?

@raja_ias can you explain, what you are doing in the process, and what you want to achieve?

Some inputs and outputs would be helpful as well.


I want the text to start with “The rupee surged…”

Please give a try, outp.substring(ind,last-1)

if that didn’t work try this,

System.Text.RegularExpressions.Regex.Matches(outp,"(?<=rupee surged)[\w\W\s\S\n\d\D]*")(0)


Assign: Specified argument was out of the range of valid values.
Parameter name: i

Now this error bro :pensive:

Can you please show the error screenshot and workflow.


Rupee surges 27 paise to 74.19 against U.S. dollar in early trade - The Hindu

This is the link that I used to get a text.If u r free pls try to get a text from this link

Thanks, @prasath_S