Delphi编程--字符处理


======================================================
注:本文源代码点此下载
======================================================

定位

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^)/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值