白拿分的机会。谁能贴出D5中ExcludeTrailingBackslash函数的源码。(30分)

李光

Unregistered / Unconfirmed
GUEST, unregistred user!
今天早是得到了一个D5的例子,但是其中ExcludeTrailingBackslash函数D4不支持故想请大
家帮忙贴出来。小弟30分献上。
 
function IsPathDelimiter(const S: string;
Index: Integer): Boolean;
begin
Result := (Index > 0) and (Index <= Length(S)) and (S[Index] = '/')
and (ByteType(S, Index) = mbSingleByte);
end;

function ExcludeTrailingBackslash(const S: string): string;
begin
Result := S;
if IsPathDelimiter(Result, Length(Result)) then
SetLength(Result, Length(Result)-1);
end;
 
来迟了!
不过就是去除尾部反斜杠吗?
 
to 屯兄:
一句话,加分!
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
968
SUNSTONE的Delphi笔记
S
顶部