String objects provide many methods, but few programmers make full use of them, which is a defect for a programmer. The methods provided by the string can be used to operate characters, generate HTML tags, and search strings.
The following describes what a string is. In JavaScript, a string is an object. As in Java, th
, string str_ type functionStr_getcsv ($STR); Converts a CSV file string into an array of str_replace ($search, $replace, $subject [, $count]);//Search and replace string //Fourth parameter is specified, will be assigned to him the number of times Str_ireplace ($search, $replace, $subject [, $count]);//Search and replace the
Php string processing functions. PHP can process strings in a variety of ways, but sometimes you need to select the simplest and ideal solution. The article lists 10 common PHP strings. PHP has very powerful processing capabilities and diverse methods, but sometimes you need to choose the simplest and ideal solution. This article lists 10 common cases of string p
Stroul,StrdupSnprintf ()AtioCommon string operation functions in C# Include Size_t strlen (const char * s) measures the actual length of String Length S.For example, if s [20] = "ABC", the result of strlen (s) is 3 rather than 20. This is the actual length.Char * strcat (const char * S1, const * S2) connects string S2
The process of learning PHP, sorting out some of the commonly used functions, which are string functions.
Header ("Content-type:text/html;charset=utf-8");Delete both sides (single-sided) spaces or other pre-defined characters$str = "# #hello world@@";Echo Trim ($str, ' #,@ '). ""; Hello WorldEcho LTrim ($str, ' # '). ""; Hello world@@Echo RTrim ($str, ' @ ').
PHP Eighth lesson string splitting common functions
Course Outline:
This lesson allows you to perform basic operations on strings.
String Knowledge Points:1. Introduction to Handling strings2. Commonly used string output functions3. Commonly used string formatting function
SQL string functions, including many operations such as space-removing functions to retrieve substrings, function strings, comparison functions, string operations, function data type conversion functions, date
PHP String Handling functions
Addcslashes? Adds a backslash escape character to a partial character inside a stringAddslashes? Escapes characters inside a string in the specified mannerBin2Hex? Converts binary data to hexadecimal representationChop? alias function for RTrim ()Chr? Returns the ASCII code of a characterChunk_split? Splits a
PHP Class 8 string splitting common functions
Course Overview:
This lesson allows you to perform basic operations on strings.
String knowledge point:1. Introduction to string processing2. Common string Output Functions3. common string
This example summarizes the common string manipulation functions and usages in JavaScript. Share to everyone for your reference. The specific analysis is as follows:
Recently participated in the front-end intern recruitment of the written test, found that many of the written questions will be the test to string processing, such as where to go to the net-pen ques
.
Str_shuffle? Random Sorting of characters in a string
Str_split? Splits a string into an array based on the character spacing.
Str_word_count? Obtain the English word information in the string.
Strcasecmp? Compare the size of a string, case insensitive
Strchr? Returns the alias of some strstr ()
: Convert lowercase letter to uppercase (function)
2. # Include Int getchar (void); // reads characters from the standard input device and returns an integerChar * get (char * s); // read characters from the standard input device to the array s until a newline or file Terminator is encountered, and then add NULL characters to the array.Int putchar (int c); // print charactersInt puts (const char * s); // print string s and New Line CharacterInt sprint
charlist])These three functions are used to remove white-space characters or other predefined characters from the left, right, and ends of a string, respectively. The processed results are returned as a new string and are not modified on the original string. Where the first parameter, str, is the
Common built-in functions awk built-in string functions
Gsub (R,s) replaces R with s in the entire $
Gsub (R,S,T) replaces R with S in the whole t
Index (S,T) returns the first position of the string T in S
Length (s) returns s
Match (S,R) tests if s contains a string that m
Summary of PHP5 string processing functions, which are frequently used by php users. Easy to search and use. Addcslashes-add the backslash escape character addslashes to some characters in the string-escape the characters in the string in the specified way bin2hex-Convert binary data into hexadecimal PHP5
Summary of use of PHP string comparison functions strcmp () and strcasecmp (), strcmpstrcasecmp. In summary of the use of PHP string comparison functions strcmp () and strcasecmp (), strcmpstrcasecmp is one of the important features of string processing
size, case insensitive
Strchr -- returns the alias of some strstr () functions of a string through comparison.
Strcmp -- compare the size of a string
Strcoll-compare the string Size Based on Local Settings
Strcspn -- returns the value of consecutive non-matching lengths.
Strip_tags -- remove the HTML and PHP code in a
string literal starts with the specified substring str, and if beg and end exist, it is detected within the specified range, Yes returns True, NO returns falseThe Strip () Str,strip ([chars]) method intercepts the space before and after the string (or the specified character chars) and returns the new truncated stringThe Swapcase () str.swapcase () method returns a new
given string to uppercase
vfprintf-returns the data as required and writes directly to the document stream
vprintf-to display data as required
vsprintf-returns the data as required, but does not output
wordwrap-the string according to a certain character length
The Strtolower () function converts all characters to lowercase, and the strtoupper () function turns all characters into uppercase, and the Ucfirs
(1) the first two functions of echo, print, printf, and sprintf are output strings. if there is a variable name in the string, it is replaced with its value. the last two functions are similar to C functions with the same name. (2) strchr, strlen, strtok, strrchr, strrev, strstr, strtolower, strtoupper, substr, and ucf
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.