The built-in function str () and the repr () or the inverse quote operator ("') can easily be used as strings to obtain information about the object's content, type, numeric properties, and so on.The STR () function gets a good string readability
9.4, _ del _, _ doc _, _ dict _, _ module _, _ getitem _, _ setitem _, and __,__ delitem _, _ str _, _ call __, __del ____ doc ___ Del __:
Called destructor
When an object is deleted, the python interpreter calls the _ del _ () method by
Coding1. The earliest ascii:8 bit, 1 bytes (8bit=1byte), the most basic, 128 code bit2.GBK GB Code: 16-bit, 2-byte3.unicode Universal Code: 16-bit, 2-byteUtf-8: English 8bit 1 bytes; Euro 16bit 2 bytes; medium 24bit 3 bytesOverview of basic data
functions defined within the STR type
Capitalize: Capitalize the first letter, the remaining lowercaseFunction prototype: def capitalize (self)Usage:
Str1.capitalize ()
Casefold: Change All lowercaseFunction prototype: def
Str_replace
(PHP 4, PHP 5)
Str_replace-replace all occurrences to the search string with the replacement string
DescriptionMixed Str_replace (mixed
$search, mixed
$replace, mixed
$subject[, int
&$count] )
This function returns a string or "an
What is a regular expression?Many programming languages support regular expressions. This article only discusses Regular Expressions in JavaScript.
Create a regular expressionMethod 1:
Var reg =/pattern/; Method 2:
Var reg = new RegExp ('pattern');
Document directory
C {n}
C {m, n}
C {n ,}
*, + ,?
Greedy and non-greedy
Matching results of sub-regular expressions are not recorded
Forward pre-Query
?!
Global match, modifier g
Case-insensitive, modifier I
The end of the first line,
Recently, dedecms reported bugs. here we will share with you the php filter function. let's see how to use the function code:
The code is as follows:
// Php batch filter post and get sensitive dataIf (get_magic_quotes_gpc ()){$ _ GET =
Php filters all malicious characters (batch filters post and get sensitive data ). Function Code: Copy the code as follows: php batch filter post, get sensitive data if (get_magic_quotes_gpc () {$ _ GETstripslashes_array ($ _ GET ); $ _
Function Code:Copy codeThe Code is as follows:// Php batch filter post and get sensitive dataIf (get_magic_quotes_gpc ()){$ _ GET = stripslashes_array ($ _ GET );$ _ POST = stripslashes_array ($ _ POST );}Function stripslashes_array (& $ array
Php filters html strings to prevent SQL injection of instance code. Php filters html strings to prevent SQL injection. it uses functions to process the strings to be written to the database to filter illegal information and malicious html code! Code:
The following small series for everyone to bring a python str operation method (detailed). Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
1. Str.format ():
Original: PHP in $ $str "$$" explanationThis notation is called a mutable variable.Sometimes it is convenient to use variable variable names. That is, the variable name of a variable can be set and used dynamically. An ordinary variable is set by a
About TypeError: strptime () argument 1 must be str, not bytes parsing, typeerrorstrptime
An error occurs when datetime. strptime (s, fmt) is used to output the result date.
TypeError: strptime () argument 1 must be str, not bytes
My source code is
This article introduces the $ explanation of variable $ str in php, which is very simple and practical, with a simple example. If you need it, you can refer to it.
This article introduces the $ explanation of variable $ str in php, which is very
: This article describes $ in $ str in php. For more information about PHP tutorials, see. This method is called variable.
Sometimes it is convenient to use a variable name. That is to say, the variable name of a variable can be dynamically set and
This article mainly introduces PHP to determine whether STR string is an XML format data method, combined with the case of the form of a more detailed analysis of PHP using custom functions for XML Format data validation of the relevant operation
List&dict&stringThese three types are the most commonly used data types in Python. They're all a kind of sequence.Sequence common operations1. shardingS[A:B] Returns the fragment from S[a] to s[b-1] in the sequence s. Note s[0:0] is an empty set and
Write the function definition for the following function prototype:int Ascii_to_integer (char *str);The string argument must contain one or more numbers, and the function should convert the numeric characters to integers and return the integer. If
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.