Главная страница
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.02 c
1-1188494084
Efir
2007-08-30 21:14
2007.11.18
Отображение содержимого формы при перетаскивании


15-1192064592
Маск
2007-10-11 05:03
2007.11.18
Какой лучше использовать компонент, для отображения данных в


2-1193400497
vajo
2007-10-26 16:08
2007.11.18
Нужно внести изменения в текстовом файле на сайте.


15-1192196677
parrot
2007-10-12 17:44
2007.11.18
просто абассака (~2 мб)


4-1178966232
KioLie
2007-05-12 14:37
2007.11.18
Кнопка приложения в taskbar е