区分汉字和字母的函数
2006-11-07 17:47
176 查看
区分汉字和字母的函数delphi
function gthz(s:string):string;
var i:integer;
begin
result:='';
for i:= 0 to Length(s) do
begin
if (Ord(s[i]) >= 127) then
result:=result+s[i];
end;
end;
区分汉字和字母的函数 sqlserver
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[gethz]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[gethz]
go
Create function gethz( @string nvarchar(4000) )
returns nvarchar(4000)
as
begin
declare @returnstr nvarchar(4000)
set @returnstr=''
DECLARE @position int, @nstring nchar(9)
SET @position = 1
WHILE @position <= DATALENGTH(@string)
BEGIN
if UNICODE(SUBSTRING(@string, @position, 1))>127
set @returnstr= isnull(@returnstr,'')+ SUBSTRING(@string, @position, 1)
set @position = @position + 1
END
return @returnstr
end
function gthz(s:string):string;
var i:integer;
begin
result:='';
for i:= 0 to Length(s) do
begin
if (Ord(s[i]) >= 127) then
result:=result+s[i];
end;
end;
区分汉字和字母的函数 sqlserver
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[gethz]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[gethz]
go
Create function gethz( @string nvarchar(4000) )
returns nvarchar(4000)
as
begin
declare @returnstr nvarchar(4000)
set @returnstr=''
DECLARE @position int, @nstring nchar(9)
SET @position = 1
WHILE @position <= DATALENGTH(@string)
BEGIN
if UNICODE(SUBSTRING(@string, @position, 1))>127
set @returnstr= isnull(@returnstr,'')+ SUBSTRING(@string, @position, 1)
set @position = @position + 1
END
return @returnstr
end
相关文章推荐
- Oracle的汉字转拼音首字母的函数
- [MSSQL]取汉字首字母的两个函数
- MySQL中文汉字转拼音的自定义函数和使用实例(首字的首字母)
- 取汉字拼音首字母的函数
- 汉字转换拼音或拼音首字母(两个函数)
- 获得汉字拼音首位字母的函数
- PHP将汉字转化成拼音的函数(用于取首字母索引或按字母排序中文)
- sql获取首字母函数|sql怎样获取汉字首字母
- MySQL中文汉字转拼音的自定义函数和使用实例(首字的首字母)
- PostgreSQL获取汉字拼音首字母函数
- js控制文本框输入的内容为(数字、字母、汉字)(二、js在函数中实现)
- php获取汉字首字母的函数
- Oracle 函数获取汉字拼音的首字母
- 取汉字拼音首字母的函数
- php 获取汉字拼音首字母的函数
- 使用ORACLE函数实现按汉字拼音首字母查询
- delphi汉字首字母索引函数
- 汉字转拼音首字母函数
- 汉字转拼音首字母函数
- php获取汉字首字母的函数