文件名称:Delphi_205670
介绍说明--下载内容均来自于网络,请自行研究使用
Delphi在一段文字中分别统计中文字符和英文字符个数,程序智能判断是中文还是英文字符,并把各自的统计结果显示出来,主要是用一个for循环遍历字符串,逐一通过调用ord函数将所有字符转换为对应的数值,再通过Length来判断各个字节所对应的字符数值是否在33~126之间,从而区分出是英文或是中文,然后下一步就好操作了,直接过滤出大于127的为中文、33~126之间的为英文,并返回到窗体的控件上显示。
-Delphi in a text are the statistics the number of Chinese characters and English characters, intelligent judgment procedure is Chinese or English characters, and the respective statistical results show, primarily with a for loop through the string, one by one by calling the function ord all character is converted to the corresponding value, and then through each byte Length to determine whether the value in the corresponding characters between 33 and 126, thereby distinguishing between the Chinese or English, and the next operation of the like, direct filtration of greater than 127 for the Chinese, between 33 to 126 in English, and return to display the controls on the form.
-Delphi in a text are the statistics the number of Chinese characters and English characters, intelligent judgment procedure is Chinese or English characters, and the respective statistical results show, primarily with a for loop through the string, one by one by calling the function ord all character is converted to the corresponding value, and then through each byte Length to determine whether the value in the corresponding characters between 33 and 126, thereby distinguishing between the Chinese or English, and the next operation of the like, direct filtration of greater than 127 for the Chinese, between 33 to 126 in English, and return to display the controls on the form.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Code\delphi\pudn\upandload\DATA\Delphi_205670\Delphi_205670\rd.txt
....\......\....\.........\....\.............\.............\统计中英文字个数\Project1.cfg
....\......\....\.........\....\.............\.............\................\Unit1.dfm
....\......\....\.........\....\.............\.............\................\Project1.dpr
....\......\....\.........\....\.............\.............\................\Unit1.pas
....\......\....\.........\....\.............\.............\................\Project1.res
....\......\....\.........\....\.............\.............\统计中英文字个数