zoukankan      html  css  js  c++  java
  • 区分汉字和字母的函数

    区分汉字和字母的函数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



  • 相关阅读:
    cookie和session会话技术
    hdoj 1176 免费馅饼
    nyoj 14 会场安排问题
    hdoj 1575 Tr A
    poj 1163 The Triangle
    hdoj 2157 How many ways??
    贪心Poj1328
    贪心 序列
    差分约束Poj 3169 Layout
    差分约束Poj3159 Candies
  • 原文地址:https://www.cnblogs.com/azhai/p/553227.html
Copyright © 2011-2022 走看看