作者:admin 来源: 日期:2019/10/16 10:33:13 人气: 标签:
function TrimSlashes(s: string; all: Boolean = False): string;begin while (s <> '') and CharInSet(s[1], ['/', '\']) do Delete(s, 1, 1); if all then while (s <> '') and CharInSet(s[length(s)], ['/', '\']) do Delete(s, length(s), 1) else while (s <> '') and (s[length(s)] = '\') do Delete(s, length(s), 1); Result := s;end;
如:c:\123\ 结果 c:\123如:http://www.baidu.com/ 结果 http://www.baidu.com