There is a string "[lightinthebox]", but I just need lightinthebox, just not "[]". How to remove it quickly and effectively.
stringObject.substring(start,stop) //The start and end strings are intercepted.
stringObject.substr(start,length) //The start and string length are intercepted.
Consider these and connect methods.
stringObject.substr(1).substring(-1,0) //It’s feasible.
Here’s an interception time. Nowadays, there are people who want to change the one digit into two digits. For example, 9 is displayed as 09 to facilitate format alignment.
In many places, it is judged whether the number is less than 10 to determine whether to add 0
If we use a string, there is no need to judge, just add one digit and intercept the last two digits, 01, 010, 011 It becomes 01 10 011