String - JavaScript | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

+ and += string operators

Strings are useful for holding data that can be represented in text form. Some of the most-used operations on strings are to check their length, to build and concatenate them using the + and += string operators, checking

Object.defineProperty()

There are two ways to access an individual character in a string. The first is the charAt() method:

toLocaleLowerCase("tr")

Use the less-than and greater-than operators to compare strings:

String primitives and String objects

Note that JavaScript distinguishes between String objects and primitive string values. (The same is true of Boolean and Numbers.)

String primitives and String objects

Note that JavaScript distinguishes between String objects and primitive string values. (The same is true of Boolean and Numbers.)

String primitives and String objects

Note that JavaScript distinguishes between String objects and primitive string values. (The same is true of Boolean and Numbers.)

String primitives and String objects

Note that JavaScript distinguishes between String objects and primitive string values. (The same is true of Boolean and Numbers.)

String primitives and String objects

Note that JavaScript distinguishes between String objects and primitive string values. (The same is true of Boolean and Numbers.)

String primitives and String objects

Note that JavaScript distinguishes between String objects and primitive string values. (The same is true of Boolean and Numbers.)

converted to a primitive

[Symbol.toPrimitive]()

UTF-16 characters, Unicode code points, and grapheme clusters

A "lone surrogate" is a 16-bit code unit satisfying one of the descriptions below:

UTF-16 characters, Unicode code points, and grapheme clusters

A "lone surrogate" is a 16-bit code unit satisfying one of the descriptions below:

UTF-16 characters, Unicode code points, and grapheme clusters

A "lone surrogate" is a 16-bit code unit satisfying one of the descriptions below:

UTF-16 characters, Unicode code points, and grapheme clusters

A "lone surrogate" is a 16-bit code unit satisfying one of the descriptions below:

UTF-16 characters, Unicode code points, and grapheme clusters

A "lone surrogate" is a 16-bit code unit satisfying one of the descriptions below: