Because there is a need to intercept the string in the project, and then the hand residue using the IDE automatically prompts the substr, did not think so many think substr and substring not much different.
But not, and listen to my one by one-way.
First, substr functionSUBSTR (target string, start position, length)Note: Here the third parameter: length, equivalent to the scalar in physics, there is no directionality, so you cannot use negative values. Although no error, but choose No value
Differences between substring and substr in JSSubstring: This method can have either a parameter or two parameters. (1) One parameter: Example: var str = "Olive"; str. substring (3); Result: "ve" Description: When a substring has only one parameter,
This article describes the differences between strstr, strrchr, substr, and stristr functions in php. these four functions are commonly used string-related functions in PHP, for more information about how to use strstr, strrchr, substr, and stristr
In php, The substr (), mb_substr (), and mb_strcut functions are character truncation functions. However, when substr intercepts Chinese characters, garbled characters are generated, and the two support Chinese truncation. I will introduce them
Example excerpt from http://www.w3school.com.cn/jsref/jsref_obj_array.asp1.slice ();Both array and string objects haveSlice (I,[j]) in arrayI is the index value that begins to intercept, the negative number represents the index value from the end, 1
This article describes the differences between strstr, strrchr, substr, and stristr functions in php. these four functions are commonly used string-related functions in PHP, for more information about how to use strstr, strrchr, substr, and stristr
Difference analysis between substr (), mb_substr () and mb_strcut functions in php
This article introduces the usage and difference of the string truncation function, substr (), mb_substr () and mb_strcut in php. For more information,
Php uses substr () and strpos () to search for a specific character in a string. Php uses substr () and strpos () to search for a specific character in a string. this example describes how to use substr () and strpos () in php () the method used by
Get substringSlice () substr () substring () does not modify the string itself, they simply return a basic type of string valuevar str= ' abcdefghijklmn ';1. Pass a parameterIf positive: three returns the same result ( from the parameter subscript
The difference and usage of PHP substr (), Mb_substr () and Mb_strcut and the truncate regulator in Smarty template
PHP substr () function can split the text, but to split the text if the inclusion of Chinese characters tend to encounter problems,
Both substr and substring are JS string truncation functions. The two functions are similar in usage, but they are different in many places. Next I will summarize the usage and differences between substr and substring.
The syntax of the two is as
1, using the Mbstring expansion Library MB_SUBSTR interception will not appear garbled.
2, write the Intercept function, but the efficiency is not as high as the Mbstring expansion library.
3, if only for the output of the intercepted string, can
Important: Unlike the slice () and substr () methods, substring () does not accept negative parameters.The substring (Position1,position2) method is used to extract the character of a string intermediary between two specified subscripts. includes
/*Definitions and usageThe substr () function returns the extracted substring or FALSE when it fails.
GrammarSUBSTR (String,start,length)
Parameter descriptionString required. A string that stipulates the part to return.StartNecessary. Specify
We know that sometimes use substr to intercept UTF-8 Chinese strings, often garbled, why there is such a problem, this article tells you the answer.
Look at this piece of code (character encoding is UTF-8):
Copy Code code as follows:
PHP strstr, STRRCHR, substr, stristr Four functional usage differences:
PHP strstr STRRCHR substr stristr These four string manipulation functions are especially confusing, often substr,strstr, which can basically satisfy the operation of the
in
Oracle/plsql, the
substrFunctions allows to extract a substring from a string.
The syntax for the
substrfunction is:
substr(String, start_position, [length])
Description
The string is the source string.
Start_position is the position for
Slice ()
Definition: Accepts one or two arguments, and the first parameter specifies the start position of the substring. The second parameter represents the end position of the substring (excluding the character at the end position), and if no
Select Riskcode,outriskcode,riskname,suppliercode, (select min (inputdate) from Fccont where Innercontno in (select Innercontno from Fcpol where Riskcode=t.riskcode and Biztype= ' "and Corporation in (' 1137000003 ', ' 1137000004 '))) from Mr ISK T
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.