Autor Beitrag
masteroffinalfantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82

Win XP
Delphi 2005 Architect
BeitragVerfasst: Sa 13.01.07 14:33 
Tag auch, freunde der Sonne :)

Mal ne Frage: wie kann ich das Hochkomma ( also ' ) als string darstellen?


Zuletzt bearbeitet von masteroffinalfantasy am Sa 13.01.07 15:37, insgesamt 1-mal bearbeitet
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 13.01.07 14:34 
Gan einfach doppelt im String verwenden ...

ausblenden Delphi-Quelltext
1:
'Hallo ''Welt''!'					

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
masteroffinalfantasy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82

Win XP
Delphi 2005 Architect
BeitragVerfasst: Sa 13.01.07 15:36 
hmm...
naja dann änder ich mal das topic :D

Jetzt geht es um folgendes:

Ich will die Funktion Explode benutzen um aus dem string '1.0 den string 1,0 zu machen da hatte ich eigentlich folgendes gedacht:


ausblenden Delphi-Quelltext
1:
a:=explode('''',stringa);					

wäre dann doch eigentlich a folgendes:

a('',1.0) oder?

leider steht aber bei a:

a('','1.0)
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 13.01.07 15:44 
Ähh, unter Implode und Explode verstehe ich das Splitten eines Strings in mehrere Strings an Trennzeichen. Bzw. das Zusammensetzen eines String-Arrays zu einem String.
Was du da sagst, hört sich aber eher danach an, als wolltest du etwas in einem String ersetzen (, zu .) ... Und da gibts ReplaceString bzw. StringReplace.

Oder was meinst du sonst? :gruebel:
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Sa 13.01.07 16:12 
user profile iconmasteroffinalfantasy hat folgendes geschrieben:

a('',1.0) oder?
Nein:

ausblenden Delphi-Quelltext
1:
2:
3:
  const Trenner1 = ''''; // '
  const Trenner2 = ''''''; // '' 
  //da: das erste und letzte steht für einen String, '' für _ein_Hochkomma!
Übrigens: Woher hast du die Funktion Explode?

Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
masteroffinalfantasy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82

Win XP
Delphi 2005 Architect
BeitragVerfasst: Sa 13.01.07 16:25 
user profile iconjaenicke hat folgendes geschrieben:
Ähh, unter Implode und Explode verstehe ich das Splitten eines Strings in mehrere Strings an Trennzeichen. Bzw. das Zusammensetzen eines String-Arrays zu einem String.
Was du da sagst, hört sich aber eher danach an, als wolltest du etwas in einem String ersetzen (, zu .) ... Und da gibts ReplaceString bzw. StringReplace.

Oder was meinst du sonst? :gruebel:

Ja hatte es auch mal mit stringreplace versucht, ging leider nich :(.

Die Explodefunktion hab ich aus nem beitrag hier im forum, funktionert ansonsten auch einwandfrei bei anderen dingen
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 13.01.07 16:34 
Meinst du stringa := ReplaceString(stringa, ',', '.');? Das ersetzt jedes Komma im String durch einen Punkt...
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 14.01.07 00:10 
Ach ja: Bitte immer nur eine Frage pro Thread ... Für die nächsten Probleme ;-) Macht sich einfach etwas besser ... Vergleiche ansonsten auch mit den Richtlinien

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.