.


:




:

































 

 

 

 


 


. . . :

var s: string[n];

var s: string;

 

n - - 1..255. , 255.

 

, . ( # ) ( ^ ).

 

:

' '

#54#32#61

'abcde'^A^M

 

. , .

 

, , , .

 

char .

 

: i- st st[i]. , st - '', st[1] - '', st[2] - '', st[3] - '' .

 

(), +. :

a:= 'Turbo';

b:= 'Pascal';

c:= a + b;

 

c 'TurboPascal'.

 

<,>,=,<>,<=,>=. , , . , 0.

 

 

 

Turbo Pascal , . .

Length(s:string):integer

-

 

.

n:= length('Pascal'); {n 6}

 

Concat(s1,[s2,...,sn]:string):string

-, . . - 255 , 255 . "+" , .

 

Copy(s:string; index:integer; count:integer):string

, s, count , index.

 

.

s:= ' Turbo Pascal';

s2:= copy(s, 1, 7); {s2 ''}

s3:= copy(s, 9, 5); {s3 'Turbo'}

s4:= copy(s, 15, 6); {s4 'Pascal'}

 

Delete(var s:string; index,count:integer)

- s count , index.

 

.

s:= ' Turbo Pascal';

delete(s,8,6); {s ' Pascal'}

 

Insert(source:string; var s:string;index:integer)

source s, index .

 

.

s:= ' Pascal';

insert('Turbo ',s,9); {s ' Turbo Pascal'}

 

Pos(substr,s:string):byte

s substr. . , 0.

.

s:= ' Turbo Pascal';

x1:= pos('Pascal', s); {x1 15}

x2:= pos('Basic', s); {x2 0}

Str(X: ; var st: string)

X st.

 

Val(st: string; x: ; var code: integer)

, st, , x. x - , . st ( ) , , code . , . code 0, .

 

, char, .

 

Chr(n: byte): char

, n. n , #n.

 

Ord(ch: char): byte;

ch.

 

UpCase(c: char): char;

c - , , c .

 

1.

informatika.

Forma.

1 : Delete, Upcase

2 : Copy ( ), Upcase

 

2.

. , . ,

If pos(x, str)> 0 then delete (str, pos(x, str), length(x))

P:= pos(x, str);

If p> 0 then delete (str, p, length(x))

 

3.

. .

P:= pos(x, str); n:=0;

While p>0 do begin

delete (str, p, length(x)); inc(n); str(n, n_str);

insert(n_str, str, p);

P:= pos(x, str);

End;



<== | ==>
| (, )
:


: 2015-11-23; !; : 719 |


:

:

.
==> ...

1566 - | 1394 -


© 2015-2024 lektsii.org - -

: 0.01 .