Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.11.18;
Скачать: CL | DM;

Вниз

Как убрать перевод строки при работе с memo?   Найти похожие ветки 

 
Sergl   (2007-10-25 09:53) [0]

Здравствуйте! Помогите пожалуйста в следующем вопросе:

Допусти мы написали так:

memo.lines.add("gasfgsfgdsfg" + #13#10 + "sdfgsdfg");
memo.lines.savetofile("file.txt");
memo.lines.clear;
memo.lines.loadfromfile("file.txt");

Нужно чтобы при загрузке файла не было учтено #13#10, ну или при сохранении обработать текст так чтобы #13#10 не сохранялось.


 
stone ©   (2007-10-25 09:58) [1]

StringReplace + F1


 
Sergl   (2007-10-25 10:01) [2]


> StringReplace + F1

Что-то не помагает... А можно поконкретней.


 
stone ©   (2007-10-25 10:03) [3]

А что именно не помогает? Как ты ее используешь?


 
Sergl   (2007-10-25 10:06) [4]

Пытаюсь найти в справке делфи... что-то не ищется...


 
stone ©   (2007-10-25 10:11) [5]


> Sergl   (25.10.07 10:06) [4]
> Пытаюсь найти в справке делфи... что-то не ищется...

Плохо ищешь.

Returns a string with occurrences of one substring replaced by another substring.

Unit

SysUtils

Category

string handling routines

Delphi syntax:

function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;

C++ syntax:

extern PACKAGE AnsiString __fastcall StringReplace(const AnsiString S, const AnsiString OldPattern, const AnsiString
NewPattern, TReplaceFlags Flags);

Description

StringReplace replaces occurrences of the substring specified by OldPattern with the substring specified by NewPattern. StringReplace assumes that the source string may contain Multibyte characters.

S is the source string, whose substrings are changed.

OldPattern is the substring to locate and replace with NewPattern.

NewPattern is the substring to substitute for occurrences of OldPattern.

Flags is a set of flags that govern how StringReplace locates and replaces occurrences of OldPattern. If Flags does not include rfReplaceAll, StringReplace only replaces the first occurrence of OldPattern in S. Otherwise, StringReplace replaces all instances of OldPattern with NewPattern. If the Flags parameter includes rfIgnoreCase, The comparison operation is case insensitive.


 
Sergl   (2007-10-25 10:32) [6]

Пишу значит так:

str:="gasfgsfgdsfg" + #13#10 + "sdfgsdfg";
str:=stringreplace(str,#13#10,"",rfReplaceAll);


Выдается ошибка: не соответствие типов "TReplaceFlags" and "Enumeration"

Что он ругается на флаг? Что я делаю не так?


 
stone ©   (2007-10-25 10:33) [7]

str:=stringreplace(str,#13#10,"",[rfReplaceAll]);


 
Sergl   (2007-10-25 10:36) [8]

Все понятно, спасибо!



Страницы: 1 вся ветка

Текущий архив: 2007.11.18;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.021 c
15-1192359213
Kostafey
2007-10-14 14:53
2007.11.18
С днем рождения ! 14 октября


3-1183714878
Xmen
2007-07-06 13:41
2007.11.18
Delphi+FireBird и Диалект


2-1193229696
alll_23
2007-10-24 16:41
2007.11.18
Как лучше считать дерево из таблицы БД в TreeView?


2-1193163627
opoloXAI
2007-10-23 22:20
2007.11.18
Как вставить в TEdit знак "Ø"?


2-1193317971
JSman
2007-10-25 17:12
2007.11.18
не отображать содержимое окна при перетаскивании