ExcludeLeadingChar function
String / Filename routines |
![]() ![]() ![]() |
acUtils
|
function ExcludeLeadingChar(St: String; Ch: Char): String;
|
The ExcludeLeadingChar function removes specified character from the beginning of a string if it's exists there. For example result of IncludeTrailingChar('\Software\Microsoft\CurrentVersion', '\') will be "Software\Microsoft\CurrentVersion". It's a typical function that gets rewritten by every programmer.
|
function ExcludeLeadingChar(const St: String; Ch: Char): String;
|
begin
|
Result := St;
|
while (Result <> '') and (Result[1] = Ch) do
|
Delete(Result, 1, 1);
|
end;
|