In Oracle/PLSQL, The substr functions allows you to extract a substring from a string.
The syntax for the substr function is:
Substr (string, start_position, [length])Note:String is the source string.Start_position is the position for
Php intercepts Chinese strings and garbled characters. This was recently discovered. I have previously written an article about automatic generation of meta information.That article describes how many words are used as the description method before
Use substr Same code in Perl and PHP, with different results.Php:$addtime = "2009-04-13"; $datetime = "2008-12-31 12:00:00"; substr ($datetime, 0,10) = $addtime; echo $datetime;Compile error: Can ' t use function return value in write contextPerl:#!/
The SUBSTR function is used to intercept a part of a column of fields in the database.The function names in different databases are different (it's really a headache, isn't the database invented later the same as the one first invented ?)Copy
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
DB2 left , right functionSyntax: Left (arg,length), right (Arg,length)The left and right functions return the leftmost, rightmost length string of arg, which can be a char or binary string.egSELECT Left (name,2), right (name,2) from T1ORACLE substr (
In php, if I want to use substr () to intercept strings in full English, it would be a tragedy if it includes Chinese or English, however, we can use other methods to solve this problem.
Php intercepts Chinese strings and garbled characters. This
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
Grammar:
String substr (string $string, int $start [, int $length]), which can be used to find a matching string or character in a longer string, $string the string to be processed, $start the position to start the selection, $length is the length
The substr () function can take a specified length substring of a string, but when it encounters Chinese, it can be garbled at the end of the new string, and the following function converts a string that exceeds $len length to end with a "..." and
In this SQL statement, right join is used, that is, ldquo; (+) rdquo; the other side of the SQL statement is in the connection direction. All records on the right of the equal sign are displayed, whether it is on the left
In this SQL statement,
SubstrDefined in header file String substr (size_t pos = 0, size_t len = npos) const;Copies a substring, which is required to start at the specified position and has the specified length.If the pos equals the string length, an empty string is
Recently I made a question and encountered the problem of removing spaces before and after the string. In Java, there seems to be a string function that is trim (), which can eliminate spaces after the string. For C ++, check that a C ++ standard
Pretty Poem
Time
limit: 2 Seconds
Memory Limit: 65536 KB
Poetry is a form of literature that uses aesthetic and rhythmic qualities of language. There is many famous poets in the contemporary era. It is said a
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
Use the substr function of Oracle to obtain the string with the specified start position and length
Substr (string, start_position,[Length])For example:Substr ('This is a test',6,2) WowouldReturn 'Is'Substr ('This is a test',6) WowouldReturn 'Is a
SUBSTR (string, intercept start position, intercept length)//return intercepted wordsubstr (' Hello World ', 0, 1)//return result is ' H ' * start with a string of length 1 from the first charactersubstr (' Hello World ', 1, 1)//Returns the result
The SUBSTR function is used to intercept a portion of a column field in a database.
The names of the functions in each database are not the same (it is the egg pain, after the invention of the database can not be the same as the first invention?) )
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.