一个很有用的DELPHI字符操作函数

Unit

SysUtils

LastDelimiter(const Delimiters, S: string): Integer;

Returns the byte index of the last character that matches any character in a specified set of delimiters.

Delimiters:指定的分割符,可以是多个。

S:源字符串。

For example:

LastDelimiter('/*','123/567*/abc.txt') = 9;

remark:最后出现的分隔符号是“/”,位置是9。

LastDelimiter('./*)(','123/567/abc.txt') = 12;

remark:最后出现的分隔符号是“.”,位置是12。

你可能感兴趣的:(Delphi)