String index out of range: 100 error report details and Solutions

The length of the string is not that long so the interception fails.

After debugging here, you can see that the exception is in the substring:

IndexOf (indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf)
 
The concept of heap String is not clear. Here is an introduction to the concept of strings.

 
 
Solutions to the above problems:

Read More: