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:

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:
- A repeated string is composed of two identical strings. For example, abcabc is a repeated string with length of 6, while abcba does not have a duplicate string. Given any string, please help Xiaoqiang find the longest repeated substring.
- 43. Implementation of the shortest code of multiply strings | Java
- C++ string substr()
- JSON data format net.sf.json .JSONException: A JSONObject text must begin with ‘{‘ at character 1 of Error:(f…
- VC Critical error detected c0000374 crash problem and solution
- Regarding [java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean], combined with examples
- Syntax error or access violation: 1071 specified key was too long; max key length is 767 bytes
- Difference between isempty method and isblank method in stringutils
- High precision addition function template
- Differences between length() size() and C strlen() of C + + string member functions
- Finding the longest connection path of a string
- Java – read all the files and folders in a certain directory and three methods to get the file name from the file path
- The differences between the equals method in the string class and the equals method in the object class
- error C2057: expected constant expression (Can the size of an array in C language be defined when the program is running?)
- Vue: cannot read property ‘substring’ of undefined“
- Definition of bracket type in typescript
- JVM start error: could not reserve enough space for object heap error
- How to use Python split() function (split array)
- [leetcode] zigzag transformation
- Java compareto() method