Character Handling: JavaScript substring () Method

The JavaScript browser language provides the developer with the ability to efficiently work with strings and full access to the DOM tree, which builds for every page opened by a site visitor.

javascript substring




The arsenal of string functions available through the methods of the string object is quite large. Converting various data types to strings is done automatically when the need arises. Retrieving data through the JavaScript substring () method is a sought-after operation.

Syntax and Method Usage

Any line operation manipulates characters. First of all, it is mandatory accounting coding. The developer should keep in mind: it is important not only in what encoding the string is . It is very important in which encoding the page is located , in which the code processing the string is located.

Author's example is not a picture




JavaScript substring() : , , .





, . .

Author's example is not a picture




, . , JavaScript substring , , , .

javascript substring example




, . , - , . . « ». JavaScript substring() - : - , , «NaN» .





JavaScript - . , - .

. , . JavaScript - substr:

  • ''.substr([, ])

. , . JavaScript - .

javascript courses




JS , , DOM « » . , JavaScript substring().

, , . , JS . , , . JavaScript substring() - , substr(). :

  • ;

:

  • .

. ( , ), substr.

Author's example is not a picture




JavaScript allows you to formulate the algorithm as concisely as possible without unnecessary "words". In some cases, substr is convenient, in others pop and push - although they are not related to strings at all (these are array methods), but when using the split and join pair, you can look at the use of substring in a completely different way.

JavaScript opens up possibilities. How and what to use, the developer determines.




All Articles