Home • ECDL • Algoritmi • Java • Basi di dati • Seconda prova • Eccetera • Cerca nel sito

Le stringhe

Precedente
SUPERIORE
Successiva

A "string" type variable is a sequence of characters with a dynamic length, and a constant maximum size between 1 and 255.

Syntax:

string [ constant ]

or

string

A string type declared without a maximum size is given the size 255.

String constants are written in quotes; for example: 'Turbo', 'That''s all'. Notice how two consecutive single quotes are used to indicate a single quote in a string.

These operators can be used with string type values: +, =, <>, <, >, <=, >=.

Length Length(s: string): Integer; Returns the dynamic length of a string
Pos Pos(substr: string; s: string): Byte; Searches for a substring in a string
Concat Concat(s1 [, s2,..., sn]: string): string; Concatenates a sequence of strings
Copy Copy(s: string; index: Integer; count: Integer): string; Returns a substring of a string
Insert Insert(source: string; var s: string; index: Integer); Inserts a substring into a string
Delete Delete(var s: string; index: Integer; count: Integer); Deletes a substring from a string
Str Str(x [: width [: decimals ]]; var s: string); Converts a numeric value to a string (converts the numeric value x to the same string representation that would be output by Write)
Val Val(s: string; var v; var code: Integer); Converts a string value to its numeric representation (converts the string value (s) to its numeric representation, as if it were read from a text file with Read)

Le stringhe - ApPuNtIdIuNiNfOrMaTiCo

Home • ECDL • Algoritmi • Java • Basi di dati • Seconda prova • Eccetera • Cerca nel sito

Precedente
SUPERIORE
Successiva