function GetRepStrMax(Const S : String) : integer;
var
i , n : integer;
P : PChar;
LC : Char;
begin
Result := 0;
P := Pointer(S);
if S<>'' then begin
LC := P^;
n := 0;
for i:=0 to Length(S)-1 do begin
if P[i]=LC then inc(n)
else begin
if n>Result then Result := n;
LC := P[i];
n := 1;
end;
end;
end;
end;
var
i , n : integer;
P : PChar;
LC : Char;
begin
Result := 0;
P := Pointer(S);
if S<>'' then begin
LC := P^;
n := 0;
for i:=0 to Length(S)-1 do begin
if P[i]=LC then inc(n)
else begin
if n>Result then Result := n;
LC := P[i];
n := 1;
end;
end;
end;
end;
解决方案 »
- delphi问题。
- DELPHI7中shelllistview中排序问题?
- 急干求(时间查询SQL语句)
- 关于lotus notes和delphi结合的问题(100分求助)
- Delphi调用VC的DLL,为什么老是报地址错啊?
- 请教:如何判断EDIT框中输入的是数字
- 保持字符串固定长度用什么方法或用什么函数?
- 问个问题,十分着急!!
- 查得头大了 实在没办法 来此求解 有关MapViewOfFile取得的大小问题
- VB程序,编译成exe文件,这个exe文件在运行过程中如何能删除自身。即当软件30天试用期过后,让它自行消灭,从客户的硬盘中删除。
- delphi stringgrid(画布)
- 打印问题求助
var
i , n : integer;
P : PChar;
LC : Char;
begin
Result := 0;
P := Pointer(S);
if S<>'' then begin
LC := P^;
n := 0;
for i:=0 to Length(S)-1 do begin
if P[i]=LC then inc(n)
else begin
if n>Result then Result := n;
LC := P[i];
n := 1;
end;
end;
if Result=0 then Result := n; //加这一句即可
end;
end;