Error: Assign: Index and length must refer to a location within the string. Parameter name: length / Assign: Index and length must refer to a location within the string. Parameter name: length

I used an assign tool to get the pdfname = pdfPath.Substring(pdfPath.IndexOf(“전표”)+3, pdfpath.Length-7-36)

I keep getting the error : Assign: Index and length must refer to a location within the string.
Parameter name: length AND Assign: Index and length must refer to a location within the string.
Parameter name: length

I have got the pdfPath from before which gets me the file path of the PDF no problem.

Any idea what the problem is?

You are trying to read the data which is more than the length of the string.
Please check the pdfpath length.
Consider the following example:

strInput = “Hello”
strOutput = strInput.SubString(1,2) //first parameter is starting position and second parameter is number of characters you want to extract

strOutput contains el

Regards,
Karthik Byggari