String functions are used to manipulate the data values in a column, usually of a character type.1, ASCLL (character), converts the specific character to the corresponding integer (ASCII) code, and the result is a positive number.Example: Select
1. Convert to uppercase String upperThe upper function is used to return all strings to uppercase characters.return value:varchar or nvarchar, variable-length string.Example:Select Upper (' ABCDEFG ') --output ABCDEFG Notice that it's all
2--Mathematical function 3 Select CEILING (COUNT (*)/5.0) from news--take the smallest integer greater than the result 4 select floor (COUNT (*)/5.0) from news--take the maximum integer less than the result 5 sel ECT SQRT (2)--Value open square 6
LEN (): Calculates the length of the string (the number of characters). )Datalength ();//computes the number of bytes that the string occupies, not the string function.Test the difference between a varchar variable and a nvarchar variable that
1. String length function char_length (str), Length (str)The Char_length () return value is the length of the string str, and the length of the unit is a character. A multibyte character counts as a single character. For one containing five two-byte
Character function--return character valueThese functions all receive parameters of the character family type (except CHR) and return the character value. In addition to the special instructions, most of these functions return a numeric value of
/* String function (PS. Index is calculated starting from 1) *//* Specify the character (or string) A, String B, and start index. Get the index value of a in B. */Select Charindex (' d ', ' ABCDEFG ', 0)--4Select Charindex (' BC ', ' ABCDEFG ', 0)--2
Use of string functions in C Language# Include
# Include
/*
Char s1 [] = "I am a student ";
Char s2 [20] = "teacher ";
Char s3 [] = "student ";
Int result;
Char s4 [20], * p;
1. String Length
Int strlen (char * str ):
function
Description
Addcslashes ()
Returns a string that adds a backslash before the specified character.
Addslashes ()
Returns a string that adds a backslash before a predefined character.
1: Escape () function using the CGI module>>>Import CGI>>> Stra ='\nfoo\t "Bar"'>>> Resa =Cgi.escape (stra)>>>print (RESA)Gt;foo"Bar">>> STRB ="\nfoo\t ' Bar '">>> Resb =Cgi.escape (STRB)>>>print (RESB)Gt;foo'Bar'The single and double quotation
PHP$a= "@[email protected]"; $trim=Trim($a,‘@‘);//Remove the @//var_dump ($trim) on the left and right side; $ltrim=LTrim($a,‘@‘);//Remove the @//var_dump ($ltrim) on the left; $rtrim=RTrim($a,‘@‘);//Remove the @//var_dump ($rtrim) on the
This article mainly introduces the code used to intercept string functions in Laravel and CI frameworks. For more information, see Laravel:
Function limit ($ value, $ limit = 100, $ end = '... ') {if (mb_strwidth ($ value, 'utf-8')
Ci:
Last year did not remember what to do, wrote a C # to intercept the specified length of the method, then quite a lot of trouble, because the wrong direction.For example, to intercept the string "I am 1 Chinese", take 3 bit length, the result is "I",
How to use string functions in PHP. How to use the character string function in PHP has many character string operations. The following are important: (1) the first two functions of echo, print, printf, and sprintf are output strings. how to use the
Collection of string functions in php. This article collects several common string truncation functions, which solve the problem of garbled characters in php. if you need them, you can refer to them one by one. This article collects several common
Php string functions, which are commonly used in php. 1. character location search function:
Strpos ($ str, search, [int]): searches for the first position of search in $ str starting from int;
Stripos ($ str, search, [int]): the position where the
Compare Compare the contents of a string, consider a cultural background (place), determine whether certain characters are equalCompareOrdinal and compare, but without regard to cultural backgroundFormat formats a string containing various values
MySQL string function usage instructions bitsCN.com usually uses the entire string as the operation object, such: search for a substring in a substring, obtain a substring, insert a substring at a certain position in the substring, and delete a
Generally, the entire string is used as the operation object, for example: search for a substring in a substring, obtain a substring, insert a substring at a certain position in the substring, and delete a substring.
Generally, the entire string is
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.