Autor Beitrag
Andi1982
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 497

WinXP HE
D6 Enterprise
BeitragVerfasst: Do 29.05.03 17:24 
Hallo,
ich habe mehrere Strings die ich mit QuotedStr() in Variablen gespeichert habe. Gibt es eine Funktion die genau das gegenteil macht??? Also die '' wieder wegmacht???

Gruß Andi

_________________
Solange die Bombe tickt ist alles in Ordnung, erst wenn sie damit aufhört wird es problematisch...
yukon-troll
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Do 29.05.03 20:06 
Hallo,

wie wäre es mit folgendem
ausblenden Quelltext
1:
2:
s1 := QuotedStr('blabla');
s2 := MidStr(s1, 2, Length(s1)-2);


Nachtrag:
oder wenn du es als Funktion brauchst:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
function TForm1.UnQuotedStr(s: string): string;
begin
  if (s[1] = #39) and (s[Length(s)] = #39) then
    Result := MidStr(Caption, 2, Length(Caption)-2)
  else
    Result := s;
end;


MfG yukon-troll
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Do 29.05.03 22:30 
QuotedStr() ergänzt imho auch innerhalb von Strings die netten <'>.
warum nich so:

ausblenden Quelltext
1:
2:
while pos('''',S)>0 do
  delete(S,Pos('''',S),1);

grez
msch
yukon-troll
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Fr 30.05.03 09:52 
@MSCH

die Ergänzung innerhalb des String hatte ich völlig übersehen,
habs in meiner eigenen Funktionssammlung gleich noch geändert.
danke nochmal für den Hinweis.

MfG yukon-troll
Andi1982 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 497

WinXP HE
D6 Enterprise
BeitragVerfasst: Fr 30.05.03 16:27 
Hab ne viel bessere lösung gefunden:

ausblenden Quelltext
1:
Variable := AnsiDequotedStr(InsPfad,'''')					


Funktioniert perfekt!!

_________________
Solange die Bombe tickt ist alles in Ordnung, erst wenn sie damit aufhört wird es problematisch...