Explanation of JavaScript built-in objects
Abstract: JavaScript is an object-oriented programming language (OOP ). The OOP language enables us to customize object and variable types. (In fact, it is only object-based and does not fully possess the
PHP string, phpstringPHP 5 String Function
The PHP String function is a core component of PHP. These functions can be used without installation.
Function
Description
Addcslashes ()
Returns the string with the backslash added
I. Sequence built-in functions1. sequence? First returns the first value of sequence.
2. sequence? Last returns the last value of sequence.
3. sequence? Reverse reverses the existing sequence of sequence, that is, reverse order.
4. sequence? Size
Text Functions are functions that can process text strings in formulas. For example, you can change the case sensitivity or determine the length of a text string; you can replace or remove some characters. The date and time functions can analyze and
String properties:Constructor: Returns the function that created the string attribute;Length: Returns the lengths of the strings;Prototype: Allows you to add properties and methods to an object;String properties:CharAt (): Returns the character at
JAVASCRIPT Displays dataJavaScript can output data in different ways:
Use the window.alert () pop- up warning box.
Use the document.write () method to write content to an HTML document.
Writes to an HTML element using InnerHTML .
JavaScript contains a small number of standard methods that can be used on standard types.ArrayArray.concat (item ...) it contains a shallow copy of the array and attaches 1 or more parameter item after it.The Array.join (separator) Join method
String object: Handles all string operationsMath object: Handling all mathematical operationsDate object: Handling the storage, conversion, and expression of dates and timesArray object: Provides a model of an array, storing large amounts of ordered
Python string built-in functionsPython's string commonly built-in functions are as follows:
Serial Number
Method and Description
1
Capitalize ()Converts the first character of a string to uppercase
---restore content starts---CaseA = [1,2,3,4,5]b = a #传递引用c = a[:] #拷贝, re-tear, create new object, address changePrint (ID (a), id (b), ID (c))Although the slice assigns the same value, it creates a new address. References do not point to previous
toLocaleUpperCase converts all alphabetic characters in the string to uppercase and adapts to the current locale of the host environment.
toUpperCase converts all letters in the string to uppercase letters.
The code is as follows
Array
Method
Description
Concat ()
Joins two or more arrays and returns the result.
Join ()
Put all the elements of the array into a string. element is delimited by the specified delimiter.
1
Capitalize ()Converts the first character of a string to uppercase
2
Center (width, Fillchar)Returns a string that specifies the width of the center, Fillchar is a filled character, and the default is a space.
one, the method supported by the String class:
SN (serial number)
Method Description
1
char charAt (int index)Returns the char value at the specified index.
2
int CompareTo (Object o)Compare
A string sequence is used to represent and store text, and a string in Python is an immutable object. A string is a collection of ordered characters that is used to store and represent basic textual information, a pair of single, double, or triple
Javascriptstring properties and MethodsEg:var txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";var sln = txt.length;String properties
Properties
Description
Constructor
Returns a function that creates a string property
JavascriptString ObjectString Object Properties
Properties
Description
Constructor
A reference to the function that created the object
Lenght
The length of the string
PHP syntaxThe PHP script can be placed anywhere in the document.echo "Hello world!";?>PHP variablesPHP Case SensitiveIn PHP, all user-defined functions, classes, and keywords (such as if, else, Echo, and so on) are not case sensitive.In PHP, however,
Here are a few common examples:
#define I_end_with Boost::iends_with#define I_start_with Boost::istarts_with#define I_contain Boost::icontains#define I_equal Boost::iequals#define SPLIT Boost::algorithm::split#define I_replace
The PHP ucwords () function converts the first character of each word in the string to uppercase, and this article introduces the basic use method and example of PHP ucwords () function to the code agriculture, which is interested in the code
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.