獲取字符串的長度(非字節長度)


function StrLength(CONST value:string):Integer;
Var
  s:Pansichar;
  Tail:Pansichar;
begin
  s:
=Pansichar(value);
  Tail:
=s+Length(s);
  Result:
=0;
  While (s
<Tail)  do
  begin
    
if s^ in LeadBytes then
      inc(s, StrCharLength(s))
    
else
     INC(S);
     INC(Result);
  end;
end; 
 點擊這裏給我發消息
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章