Как удалить переносы из строки |
Previous Top Next |
Code: |
function DeleteLineBreaks(const S: string): string; var Source, SourceEnd: PChar; begin Source := Pointer(S); SourceEnd := Source + Length(S); while Source < SourceEnd do begin case Source^ of #10: Source^ := #32; #13: Source^ := #32; end; Inc(Source); end; Result := S; end; |
©Drkb::00850
DelphiWorld 6.0
Можно значительно проще:
Code: |
function DeleteLineBreaks(const S: string): string; {©Drkb v.3(2007): www.drkb.ru, ®Vit (Vitaly Nevzorov) - nevzorov@yahoo.com}
begin Result := StringReplace(S, #10#13, '',[rfReplaceAll]); end; |
©Drkb::00851
Автор: Vit (www.delphist.com, www.drkb.ru, www.unihighlighter.com, www.nevzorov.org)