您的位置:首页 > 编程语言 > Delphi

Delphi编程--字符处理

2012-02-01 03:36 316 查看
======================================================

注:本文源代码点此下载

======================================================

定位
function ansilastchar(const s: string): pchar;返回ansi字符串的最后一个字符,支持多字节字符
function ansistrlastchar(p: pchar): pchar;返回以空字符串结尾的ansi字符串的最后一个字符(不包括空字符),在多字节字符中,可能不等于最后一个字节
function bytetocharindex(const s: string; index: integer): integer;返回包含index指定字节的字符位置
function chartobyteindex(const s: string; index: integer): integer;返回index指定字符的字节位置
function nextcharindex(const s: string; index: integer): integer;返回index指定字符的下一个字符起始字节位置
function strnextchar(const str: pchar): pchar;返回指定字符串的下一个字符
计数
function bytetocharlen(const s: string; maxlen: integer): integer;返回包含maxlen指定字节数的字符的个数
function charlength(const s: string; index: integer): integer;返回字符串的字节长度
function chartobytelen(const s: string; maxlen: integer): integer;返回maxlen指定的字符长度的串的字节长度
function strcharlength(const str: pchar): integer;返回字符串中第一个字符的字节长度
转换
function ansilowercasefilename(const s: string): string;将ansi字符串表示的文件名转换为小写
function ansiuppercasefilename(const s: string): string;将ansi字符串表示的文件名转换为大写
判断
function ansicomparefilename(const s1, s2: string): integer;比较两个ansi字符文件名称大小,不识别大小写
function bytetype(const s: string; index: integer): tmbcsbytetype;返回index所指定字节是单字节符还是双字节字符中第一字节或第二字节
function samefilename(const s1, s2: string): boolean;判断文件名是否相同
function strbytetype(str: pchar; index: cardinal): tmbcsbytetype;判断index指定字节是单字节字符还是双字节字符中第一字节或第二字节

======================================================

在最后,我邀请大家参加新浪APP,就是新浪免费送大家的一个空间,支持PHP+MySql,免费二级域名,免费域名绑定
这个是我邀请的地址,您通过这个链接注册即为我的好友,并获赠云豆500个,价值5元哦!短网址是http://t.cn/SXOiLh我创建的小站每天访客已经达到2000+了,每天挂广告赚50+元哦,呵呵,饭钱不愁了,\(^o^)/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: