zoukankan
html css js c++ java
Delphi中取得汉字的首字母
function Tdm.GetHzPy(
const
AHzStr:
string
):
string
;
const
ChinaCode: array[
0
..
25
,
0
..
1
] of Integer
=
((
1601
,
1636
), (
1637
,
1832
), (
1833
,
2077
),
(
2078
,
2273
), (
2274
,
2301
), (
2302
,
2432
), (
2433
,
2593
), (
2594
,
2786
), (
9999
,
0000
),
(
2787
,
3105
), (
3106
,
3211
), (
3212
,
3471
), (
3472
,
3634
), (
3635
,
3722
), (
3723
,
3729
),
(
3730
,
3857
), (
3858
,
4026
), (
4027
,
4085
), (
4086
,
4389
), (
4390
,
4557
), (
9999
,
0000
),
(
9999
,
0000
), (
4558
,
4683
), (
4684
,
4924
), (
4925
,
5248
), (
5249
,
5589
));
var
i, j, HzOrd: integer;
//
Hz: string[2];
begin
i :
=
1
;
while
i
<=
Length(AHzStr)
do
begin
if
(AHzStr[i]
>=
#
160
) and (AHzStr[i
+
1
]
>=
#
160
) then
begin
HzOrd :
=
(Ord(AHzStr[i])
-
160
)
*
100
+
Ord(AHzStr[i
+
1
])
-
160
;
for
j :
=
0
to
25
do
begin
if
(HzOrd
>=
ChinaCode[j][
0
]) and (HzOrd
<=
ChinaCode[j][
1
]) then
begin
Result :
=
Result
+
char
(
byte
(
'
A
'
)
+
j);
break
;
end;
end;
Inc(i);
end
else
Result :
=
Result
+
AHzStr[i];
Inc(i);
end;
end;
很久前的代码,忘记了来源,很好用
查看全文
相关阅读:
redis数据持久化
redis安全:给redis设置密码
redis命令总结
redis事务
redis发布订阅
Java中的日期
链式队列
删除链表中的结点(链表)、比较含退格的字符串(栈)、棒球比赛(栈)
物理层
链式栈
原文地址:https://www.cnblogs.com/wjhx/p/497727.html
最新文章
64、js取数组最大值的四种方式
62.prototype 和 proto 区别是什么?
61.new的原理是什么?通过new的方式创建对象和通过字面量创建有什么区别?
60.谈谈你对JS执行上下文栈和作用域链的理解
59.为什么会出现setTimeout倒计时误差?如何减少
afinal框架下 ViewInject的使用
Android Studio 默认keystore 以及自定义keystore
Android报“android.content.res.Resources$NotFoundException: String resource ID #0x2”错误
华为手机不打印log解决方法
do youhave youare you
热门文章
Android Studio 连接天天、海马、逍遥模拟器
快速开启-控制面板的方法
授权流程
zg 作业一
Andriod Studio adb 安装应用
shiro系列1:简介
springboot整合shiro:基于redis+JWT+shiro的授权管理
layui表格和分页使用案例
springboot整合mybatisplus报错:Failed to process, please exclude the tableName or statementId错误
redis优化
Copyright © 2011-2022 走看看