Skip to content

Commit

Permalink
baseunit, add removeurldelim function
Browse files Browse the repository at this point in the history
  • Loading branch information
riderkick committed Aug 1, 2015
1 parent 2d972ce commit 4a8fe4e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions baseunits/uBaseUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,8 @@ function CleanAndExpandURL(const URL: String): String;
function CleanURL(const URL: String): String;
function AppendURLDelim(const URL: String): String;
function AppendURLDelimLeft(const URL: String): String;
function RemoveURLDelim(const URL: String): String;
function RemoveURLDelimLeft(const URL: String): String;
function FixURL(const URL: String): String;
function FixPath(const path: String): String;
function GetLastDir(const path: String): String;
Expand Down Expand Up @@ -2299,6 +2301,20 @@ function AppendURLDelimLeft(const URL: String): String;
Result := '/' + URL;
end;

function RemoveURLDelim(const URL: String): String;
begin
Result := URL;
if (URL <> '') and (URL[Length(URL)] = '/') then
SetLength(Result, Length(Result) - 1);
end;

function RemoveURLDelimLeft(const URL: String): String;
begin
Result := URL;
if (URL <> '') and (URL[1] = '/') then
Delete(Result, 1, 1);
end;

function FixURL(const URL : String) : String;
begin
Result := URL;
Expand Down

0 comments on commit 4a8fe4e

Please sign in to comment.