Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#13

AW: führende null entfernen

  Alt 1. Aug 2018, 15:30
Wie wärs einfach hiermit?
Delphi-Quellcode:
function RemLeadChar(const Input: string; const LeadChar: Char): string;
begin
  if Length(Input) > 0 then
  begin
    Result := Input;
    while (Result[1] = LeadChar) do
      delete(Result, 1, 1);
  end
  else
    Result := '';
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat