Thema: Delphi Copybefehl bei Strings

Einzelnen Beitrag anzeigen

Benutzerbild von Jelly
Jelly

Registriert seit: 11. Apr 2003
Ort: Moestroff (Luxemburg)
3.741 Beiträge
 
Delphi 2007 Professional
 
#12

Re: Copybefehl bei Strings

  Alt 20. Jan 2007, 13:22
Zitat von Der_Unwissende:
Wovor ich Dich ganz stark warnen würde. Die Funktion ist etwas fehlerhaft implementiert (irgendjmd. schrieb, dass es in den aktuellen Versionen noch eine korrigierte Version gibt), aber DelimitedText mit Delimiter macht immer Probleme, wenn Du Leerzeichen im String hast.
Habs grad getestet und den Fehler kann ich bestätigen Sehr unschön.

Aber wenn man mal die Doku dazu liest, scheint das so gewollt zu sein:
Zitat von Delphi Online Hilfe:
Description
Use DelimitedText to get or set all the strings in the TStrings object in a single string.
When retrieving DelimitedText, the resulting value delimits individual strings in two ways: each string is surrounded (before and after) by the quote character specified by the QuoteChar property. In addition, individual strings are separated by the character specified by the Delimiter property.
When assigning DelimitedText, individual strings must be separated using QuoteChar at both ends, using Delimiter as a separator, or using both these methods.

A space is always interpreted as a delimiter, regardless of the value of Delimiter, unless the space occurs between quote characters.
Note:
CommaText is the same as the DelimitedText property when Delimiter is ',' and QuoteChar is '"'.
  Mit Zitat antworten Zitat