createfunction
[dbo
].[f_getpy
](@str
nvarchar(4000
)) returns
nvarchar(4000
) as
begin
declare
@pytable
( ch
char(1
), hz1
nchar(1
) collate chinese_prc_cs_as_ks_ws,
hz2
nchar(1
) collate chinese_prc_cs_as_ks_ws)
insert
@pyselect'a
','吖
','鏊
'union
allselect'b
','八
','簿
'union
allselect'c
','嚓
','錯
'union
allselect'd
','噠
','跺
'union
allselect'e
','屙
','貳
'union
allselect'f
','發
','馥
'union
allselect'g
','旮
','過
'union
allselect'h
','鉿
','蠖
'union
allselect'j
','丌
','竣
'union
allselect'k
','咔
','廓
'union
allselect'l
','垃
','雒
'union
allselect'm
','媽
','穆
'union
allselect'n
','拿
','糯
'union
allselect'o
','噢
','漚
'union
allselect'p
','趴
','曝
'union
allselect'q
','七
','群
'union
allselect'r
','蚺
','箬
'union
allselect's
','仨
','鎖
'union
allselect't
','他
','籜
'union
allselect'w
','哇
','鋈
'union
allselect'x
','夕
','蕈
'union
allselect'y
','丫
','蘊
'union
allselect'z
','匝
','做
'declare
@iint
set@i
=patindex('
%[吖-做]%
' collate chinese_prc_cs_as_ks_ws,@str
) while
@i>
0select
@str
=replace(@str,substring(@str,@i,1
),ch) ,@i
=patindex('
%[吖-做]%
首字母大寫
對乙個字串中的所有單詞,如果單詞的首字母不是大寫字母,則把單詞的首字母變成大寫字母。在字串中,單詞之間通過空白符分隔,空白符包括 空格 製表符 t 回車符 r 換行符 n 輸入一行 待處理的字串 長度小於100 可能有多組測試資料,對於每組資料,輸出一行 轉換後的字串 輸入可以接受空格,回車等空白符...
string首字母大寫
定義函式將字串首字母大寫 例1 study hard,improve every day.def tojadencase string return string.title print tojadencase study hard,improve every day.例2 how can mirr...
SQL 漢字轉換拼音首字母
create function whk fun getpy str nvarchar 4000 returns nvarchar 4000 asbegin declare word nchar 1 py nvarchar 4000 set py while len str 0 begin set w...