String operator in Pascal - string

Programming is constantly associated with working with some data, in particular with strings. The string operator is specified identically in most languages, including Pascal: string. But Pascal has its own characteristics and properties that you need to know before starting work.

What is the string in Pascal?

Before you understand the syntax of a string data type in Pascal, you should understand what can be a string. In fact, in Pascal, a string is an array of characters, each of which can be any element from an ASCII table. That is, any letter, number, punctuation mark or space can be used as a string.

pascal string




255 , . , , string. Pascal , .

String. Pascal - 255. , , - string , , . "str", 10 :





var str: string[10].

Pascal string - .

, , . .

( ) . : "+". , , .

, , . , , , , , : " ".

pascal string




, Pascal, - string compare . :

  • (=);
  • / (> <);
  • (< >);
  • (>= <=).

true false.









, . , , , , , , , .

how to convert string to integer pascal




, Pascal , . , , . 4 :

  • Copy. - , , :

Copy (S, poz, n) - S - , poz n - .

  • , "+", Concat. , :

Concat(s1,s2...).

  • Length. - , . - :

Length(str).

  • - Pos. , , , 0:

Pos(subS, S).

, Pascal, . , - .

type string pascal




, Delete , , . :

Delete (S, poz, n).

Insert. - , , :

Insert(subS, S, poz).

, . , , string integer. Pascal , , , , . :

  • string integer Pascal StrToInt. , .
  • , StrToFloat. , , .

array string pascal




  • - - FloatToStr IntToStr .
  • , , - Str Val. - . , - , , . , , , , , , 0.




All Articles