Показать сообщение отдельно
  #6  
Старый 25.09.2011, 23:54
Аватар для angvelem
angvelem angvelem вне форума
.
 
Регистрация: 18.05.2011
Адрес: Омск
Сообщения: 3,970
Версия Delphi: 3,5,7,10,12,XE2
Репутация: выкл
По умолчанию

Неужели тяжело справку почитать?
Цитата:
Returns the index value of the first character in a specified substring that occurs in a given string.

Delphi syntax:

function Pos(Substr: string; S: string): Integer;

Description

In Delphi, Pos searches for a substring, Substr, in a string, S. Substr and S are string-type expressions.

Pos searches for Substr within S and returns an integer value that is the index of the first character of Substr within S. Pos is case-sensitive. If Substr is not found, Pos returns zero.
Код:
var
  S : string;
begin
  S := '   123.5';
  { Convert spaces to zeros }
  while Pos(' ', S) > 0 do
    S[Pos(' ', S)] := '0';
end;
__________________
Je venus de nulle part
55.026263 с.ш., 73.397636 в.д.
Ответить с цитированием