Alibabacloud.com offers a wide variety of articles about javascript substr vs substring, easily find your javascript substr vs substring information here online.
This article describes the attributes and methods of String objects of JavaScript native objects. This article describes the attributes and methods of length, charAt (), charCodeAt (), concat (), and indexOf (), lastIndexOf () and other method
Length
The Length property can return the number of characters in the string.
Length is obtained based on the UTF-16 encoding of the string, with an empty string length of 0. Length is not modifiable.
CharAt ()
The CharAt () method returns the
JavaScript language essence of string common method analysis 1. String Common Method Analysis 1.1 String.prototype.slice ()The slice (start,end) method copies part of a string to construct a new stringWhen startThe end parameter is optional and the
lengthThe Length property can return the number of characters in a string.Length is obtained based on the UTF-16 encoding of the string, with an empty string length of 0. Length cannot be modified.charAt ()The CharAt () method returns the character
Basic JavaScript data types and types detection, javascript Data Types1. [basic JavaScript Data Types] JavaScript has dynamic types. This means that the same variables can be of different types."String" "number" "object" "boolean" "function"
One, "JavaScript basic data Type"JavaScript has a dynamic type. This means that the same variable can be used as a different type"String" "Number" "Object" "Boolean" "function" "Undefined " String TypeProperty:Str.lengthvar str =
1: StringAny data type in JS can be viewed as an object. So string is both the basic data type and the object. 2: declaration stringBasic data type: var sStr = ' string ';Method of the object: var ostr = new String (' string '); //count the
The function:function itself is an object that can be assigned to any variableImmediate invoked function expression (Iife): function () {} ()Method vs Function: A method is a function attribute of an object (the A method is a function, which is a
Javascript provides a Regexp object to perform operations and functions on regular expressions. Each regular expression pattern corresponds to a Regexp instance. You can create an instance of the Regexp object in two ways.
Use Regexp's explicit
Isfinite (123);//detection is a number (this returns TRUE)isNaN (123);//detection is not a number (return false here)
' Hello World '. IndexOf (' A ', 2);//Find matching character position does not return-1, note the following optional parameters
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.