Autor Beitrag
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mo 01.11.04 17:46 
hi,
immer wenn ich über mein Delphi - Programm eine Nachricht erhalte und diese in eine Listview einfüge, siegt das so aus:
user defined image

zum schluss sind da 2 kleine kästchen, wie kann ich diese entfernen ?

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
Default112
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Mo 01.11.04 17:50 
Das sind die Sonderzeichen #13 und #10 was soviel wie ein "Return" bedeutet. Einfach abschneiden :)

ausblenden Delphi-Quelltext
1:
DELETE(LENGTH(MeinString)-2,2,LENGTH(meinString));					

Wenn ich mich nicht irre.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 01.11.04 17:54 
Nicht ganz:
ausblenden Delphi-Quelltext
1:
  DELETE(MeinSting, LENGTH(MeinString)-1,2);					

Das ist besser. :wink:
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mo 01.11.04 18:05 
k, aber es können auch mal 4 kästchen am ende sein... wie kann ich diese entfernen, wenn ich nicht weiß, wieviele das sind ??

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: Mo 01.11.04 18:11 
Wie wärs denn mit Trim?

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind
Default112
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Mo 01.11.04 18:21 
jasocul hat folgendes geschrieben:
Nicht ganz:
ausblenden Delphi-Quelltext
1:
  DELETE(MeinSting, LENGTH(MeinString)-1,2);					

Das ist besser. :wink:


*autsch* peinlich...
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mo 01.11.04 18:22 
mhh, eigentlich sind es genau genommen keine leerzeichen, sonder zeilenumbrüche oder so. Das entsteht immer, wenn ich eine Nachricht von ICQ empfange und eintrage. Doch diese Zeichen müssen weg, egal ob am anfang oder am ende...

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mo 01.11.04 19:02 
Benutze StringReplace.
ausblenden Delphi-Quelltext
1:
2:
ausgabe:=StringReplace(ausgabe,#13,'',[rfReplaceAll]);
ausgabe:=StringReplace(ausgabe,#10,'',[rfReplaceAll]);

Das ersetzt jegliches Vorkommen dieser beiden Zeichen. Da du in einem Listview sowieso niemals Zeilenumbrüche gebrauchen kannst, sollte das das Problem komplett beheben.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.