• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Delphi编程--字符处理

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

定位
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指定字节是单字节字符还是双字节字符中第一字节或第二字节



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
DelphiTWebBrowser发布时间:2022-07-18
下一篇:
Delphi与DirectX之DelphiX(46):TDIB.DoAntiAlias;发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap