一個很有用的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。

發佈了40 篇原創文章 · 獲贊 19 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章