This article mainly introduces the substring and substr methods in js. It describes and describes the substring and substr methods. For more information, see
1. substring method:Used to extract the character substring (start, end) between two
This article mainly introduces details about how to use substr, substring, indexOf, lastIndexOf, split, and replace in js. For more information, see indexOf () returns the position of the first occurrence of a specified string value.
The
Simple usage of the substr function in Oracle
Substr (string, truncation start position, truncation length) // returns the truncated string (including the start position)
Select substr ('helloworld',) value from dual; -- the returned result is
The time in oracle is converted to the string to_char (), the string conversion time to_date (), and the use of substr and instr ., To_charto_date
A statement written at work
Select * from Bt_Holiday whereTo_char (Setting_DATE, 'yyyy') = Substr ('2
This article mainly introduces details about how to use substr, substring, indexOf, lastIndexOf, split, and replace in js. For more information, see indexOf () returns the position of the first occurrence of a specified string value.
The
When parsing a string that receives a serial port in LKSNAPSHOT.cpp, there is a sentence:string cmd = Msg.substr (Cmdstr.length () +1,cmdstr.length ()-cmdstr.length ()-1);Suspect substr parameter is wrong, and then find the relevant information,
I have read the previous documents these days. When I see substring (), slice (), and substr (), I am not clear about the differences between them. After reading the materials and verifying them in person, I will make the following summary:First,
Simple usage of the substr function in Oracle, oraclesubstr Function
Substr (string, truncation start position, truncation length) // returns the truncated string (including the start position)
Select substr ('helloworld',) value from dual; -- the
Substr () function Chinese edition
The normal substr () function can obtain the specified length of the string, but garbled characters may be generated at the end of the new string in case of Chinese characters, the following function converts a
Substr (STR, start, length );
Example: substr ('php is very good language );
Output is ve;
If the length of Start> STR is returned ();
Substr ('php is very good language );
Substr ('php is very good language ',4);
Output as (blank)
substr instance
$content = ' I love you www.111cn.net ';
$temp = substr ($content, 4);
Echo $temp;
Results:
Love you www.111cn.net '//
Let's take a look at the function from the right.
$temp = substr ($temp, 0,-4);
The results are:
I love
The function of split in C + + is first to understand several functionsFind_first_of or find_first_not_of in C + + with string itselfFind_last_of or Find_last_not_ofFunction prototype: can be used to search for strings, Char,char * Three types
The ordinary substr () function of the substr () function can get the specified length substring of a string, but it may be garbled at the end of a new string when encountered in Chinese, and the following function converts a string exceeding the
One, take partial string.
Copy Code code as follows:
String substr (string string, int start, int [length]);
This function extracts the length character of the string from the start of string strings. If start is a negative number,
substr (string, intercept start position, intercept length) //Returns the truncated string (containing the start position)Select substr (' HelloWorld ', 0,3) value from dual; --The returned result is Helselect substr (' HelloWorld ', 1,3) value
SUBSTR Definition and usageThe substr () method extracts a specified number of characters from the start subscript in a string.GrammarStringobject.substr (Start,length)If length is 0 or negative, an empty string is returned. If this argument is not
About the substr function, looking back at the first technical record I wrote, I found out there was a mistake.The correct format is substr ((int) subscript x, (int) length len);Interpreted as intercepting the Len string starting from subscript x
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
If the length is 0 or negative, an empty string is returned. If this parameter is not specified, the substring will continue to the end of stringvar. Differences between the substr method and the substring method of JS string Truncation
Returns a
Oracle character function lower () upper () length () substr (char, m, n) I. Character function: lower case function: lower (); usage: for example, all the names of a table are in lowercase: select lower (t. ename) from scott. emp t capital function:
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.