Object-oriented features and associative arrays of JavaScript as semantic “frameworks” for using functions and constructs for processing strings are of particular interest for programming information processing processes based on its semantic content. In JavaScript, string functions can be combined into their own semantic constructs, simplifying the code and formalizing the subject area of the task.
In the classic version, information processing is, first of all, string functions. Each function and language design has its own characteristics in the syntax and semantics of JavaScript. The methods for working with strings here have their own style, but in the usual application it is just a syntax within the framework of simple semantics: search, replace, insert, extract, content, change case ...
Description of String Variables
var. . . , «\».
, , . , , .
«str_dbl» , . «\» .
-
JavaScript . . , ( ):
- str_isV[3] => «V»;
- str_chr[1] => «'»;
- str_dbl[5] => «a».
, - . - . «» .
charAt() :
- str_isV.charAt(3) => «V»;
- str_chr.charAt(1) => «'»;
- str_dbl.charAt(5) => «a».
.
JavaScript , . ( ) . , .
( - ) - .
- var xStr = str_isV.length + '/' + str_chr.length + '/' + str_dbl.length.
: 11/12/175 .
- :
- «s» , «l». , .
.
: , - . JavaScript « » .
:
: indexOf(), lastIndexOf(), substr(), substring(), toLowerCase(), toUpperCase(), concan(), charCodeAt() .
JavaScript , , .
, concat() , :
- str = str1 + str2 + str3;
charAt() , charCodeAt() . , JavaScript : , , alert() - «\n», «<br/>». , - .
JavaScript . , .
match , replace . JavaScript , , , .
match, search replace , .
, . .
, , (schInt) (schReal). , , : schText - , schMail - .
, JavaScript , . , . .
, , . , : , .
-
JavaScript . . , .
, , , .
, .
, . : - .
, . , - , , , . . .
. . , .
, . .