The difference between the substr method and the substring method used by JS to intercept the string. If you need it, you can select it as needed.
Substr Method
Returns a substring of the specified length starting from the specified
Substr Method
Returns a substring of the specified length starting from the specified position.
Stringvar. substr (start [, length])
Parameters
Stringvar
Required. The string text or string object to extract the substring.
Start
Required. The
Substr Method Returns a substring of the specified length starting from the specified position.Stringvar. substr (start [, length])ParametersStringvarRequired. The String text or String object to extract the substring.StartRequired. The starting
substr Method
Returns a substring of the specified length starting at the specified position.
Stringvar.substr (start [, length])
Parameters
Stringvar
Required option. The string literal or string object to extract the substring.
Start
Required
Function:1. Intercept the string from left (str, length)Description: Left (truncated field, intercept length) Example: Select Left (content,200) as abstract from my_content_t2. Intercept string Right (str, length)Description: Right (truncated field,
1. Intercept string from left
Left (str, length)
Description: Left (intercepted field, intercept length)
Example: Select Left (content,200) as abstract from my_content_t
2, from the right start to intercept the string
Right (str, length)
Description:
The sense that MySQL's string function intercepts characters is more powerful than using program interception (such as PHP or Java), so make a record here and hope to be useful to everyone.
Function:
1. Intercept string from left
Left (str, length)
When creating the view today, it is very convenient to use string Truncation in MySQL.
When creating the view today, it is very convenient to use string Truncation in MySQL.
I feel that the string function of MySQL intercepts characters, which is
I feel that the string function of MySQL intercepts characters, which is more powerful than program interceptions (such as PHP or JAVA). So I want to make a record here and hope it will be useful to everyone.Function:1. Extract strings from the left
It feels like MySQL's string function intercepts characters, and is more powerful than a program intercept (like PHP or Java), so make a record here and hope it works for everyone.Function:1. Intercept string from leftLeft (str, length)Description:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.