User Tools

Site Tools


pos

Protótipo: function pos(const substring: string; const s: string): integer;

Descrição: Retorna o índice da substring em s, se esta a contiver. Caso cont rário, 0 é retornado. A busca é case-sensitive.

Exemplo:

  
program exemploPos;
 var
    s : string;
 begin
    s := 'The first space in this sentence is at position : ';
    writeln(s, pos(' ', s));
    s := 'The last letter of the alphabet doesn''t appear in this sentence ';
    if (pos ('Z', s) = 0) and (pos('z', s) = 0) then
       writeln (s);
 end.
pos.txt · Last modified: 2019/04/24 13:39 by castilho