判斷字符串中是否包含中文

--返回值   true有中文和中文符號
function UIBase:judgeHasWord(string, displayCenter)
local hasWord = false
local lenInByte = #string


for i=1, lenInByte do
local curByte = string.byte(string, i)
-- local byteCount = 1
if curByte<=0 or curByte>127 then
hasWord = true
end
end


if hasWord then
-- print("has chinese **************")
--self:inputSysTips(InputHasWord, displayCenter)
end


return hasWord
end
發佈了39 篇原創文章 · 獲贊 15 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章