<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[String in Häppchen unterteilen?]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe folgendes. Ich möchte einen String in stücke unterteilen damit ich Verzeichnisse und unterverzeichnisse erstellen kann. Leider kann man mit CreateDirectory keinen kompletten pfad angeben der dann von selbst erstellt wird, falls unterverzeichnisse nicht vorhanden sind. Insofern muss ich das ganze also selbst erledigen. Okay, der String sieht inetwa so aus:</p>
<p>*<em>C:\Verzeichnis1\Verzeichnis2\Verzeichnis3\Verzeichnis4\Verzeichnis5*</em></p>
<p>(doppel-backslash wird bereits berücksichtigt).<br />
Nun muss ich also den string in 4 teile aufteilen. Mir ist die tiefe des pfades nicht bekannt, hier in diesem beispiel ist es nun 5, das kann aber varieren. Ich müsste den string nun wie folgt aufteilen:</p>
<p>*<em>C:\Verzeichnis1\<br />
C:\Verzeichnis1\Verzeichnis2\<br />
C:\Verzeichnis1\Verzeichnis2\Verzeichnis3\<br />
C:\Verzeichnis1\Verzeichnis2\Verzeichnis3\Verzeichnis4*</em></p>
<p>Bei jedem aufteilen dann abfragen ob das verzechniss vorhanden ist oder nicht und ggf. erstellen. Das ist ja dann kein problem. aber wie teile ich den string nun elegant auf? Ich kenne die methoden SubString, Pos etc. jedoch springt mir die lösung nicht isn auge. Mir ist klar das man in einer while schleife eine variable inkrementieren könnte bis jeweils ein backslash vorkommt. Aber irgendwie weis ich jetzt nicht weiter.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/127717/string-in-häppchen-unterteilen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Jul 2026 01:03:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/127717.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 26 Nov 2005 17:35:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to String in Häppchen unterteilen? on Sat, 26 Nov 2005 17:35:47 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe folgendes. Ich möchte einen String in stücke unterteilen damit ich Verzeichnisse und unterverzeichnisse erstellen kann. Leider kann man mit CreateDirectory keinen kompletten pfad angeben der dann von selbst erstellt wird, falls unterverzeichnisse nicht vorhanden sind. Insofern muss ich das ganze also selbst erledigen. Okay, der String sieht inetwa so aus:</p>
<p>*<em>C:\Verzeichnis1\Verzeichnis2\Verzeichnis3\Verzeichnis4\Verzeichnis5*</em></p>
<p>(doppel-backslash wird bereits berücksichtigt).<br />
Nun muss ich also den string in 4 teile aufteilen. Mir ist die tiefe des pfades nicht bekannt, hier in diesem beispiel ist es nun 5, das kann aber varieren. Ich müsste den string nun wie folgt aufteilen:</p>
<p>*<em>C:\Verzeichnis1\<br />
C:\Verzeichnis1\Verzeichnis2\<br />
C:\Verzeichnis1\Verzeichnis2\Verzeichnis3\<br />
C:\Verzeichnis1\Verzeichnis2\Verzeichnis3\Verzeichnis4*</em></p>
<p>Bei jedem aufteilen dann abfragen ob das verzechniss vorhanden ist oder nicht und ggf. erstellen. Das ist ja dann kein problem. aber wie teile ich den string nun elegant auf? Ich kenne die methoden SubString, Pos etc. jedoch springt mir die lösung nicht isn auge. Mir ist klar das man in einer while schleife eine variable inkrementieren könnte bis jeweils ein backslash vorkommt. Aber irgendwie weis ich jetzt nicht weiter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/927815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/927815</guid><dc:creator><![CDATA[std::string]]></dc:creator><pubDate>Sat, 26 Nov 2005 17:35:47 GMT</pubDate></item><item><title><![CDATA[Reply to String in Häppchen unterteilen? on Sat, 26 Nov 2005 17:41:23 GMT]]></title><description><![CDATA[<p>schau mal die ersten 2-3 seiten des forums durch. da gibts 2 threads bei denen es mehr oder weniger um die gleiche problematik geht (wenn auch andersrum).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/927820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/927820</guid><dc:creator><![CDATA[GreyHound]]></dc:creator><pubDate>Sat, 26 Nov 2005 17:41:23 GMT</pubDate></item><item><title><![CDATA[Reply to String in Häppchen unterteilen? on Sat, 26 Nov 2005 17:55:40 GMT]]></title><description><![CDATA[<p>Ertmal danke für dein posting. Habe das gefunden<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-127397.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-127397.html</a></p>
<p>meintest du dass? Damit kann ich leider nichts anfangen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/927836</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/927836</guid><dc:creator><![CDATA[std::string]]></dc:creator><pubDate>Sat, 26 Nov 2005 17:55:40 GMT</pubDate></item><item><title><![CDATA[Reply to String in Häppchen unterteilen? on Sat, 26 Nov 2005 18:16:22 GMT]]></title><description><![CDATA[<p><a href="http://www.marquardtnet.info/cecke/quickies.1/1_quicky_11.html" rel="nofollow">http://www.marquardtnet.info/cecke/quickies.1/1_quicky_11.html</a></p>
<p><a href="http://www.marquardtnet.info/cecke/quickies.1/1_quicky_01.html" rel="nofollow">http://www.marquardtnet.info/cecke/quickies.1/1_quicky_01.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/927863</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/927863</guid><dc:creator><![CDATA[Christian211]]></dc:creator><pubDate>Sat, 26 Nov 2005 18:16:22 GMT</pubDate></item><item><title><![CDATA[Reply to String in Häppchen unterteilen? on Sat, 26 Nov 2005 18:18:46 GMT]]></title><description><![CDATA[<p>yo denk schon..direkter link eben.<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-127069.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-127069.html</a></p>
<p>na is natürlich kein Musterbeispiel für genau dein Problem aber es geht auch um Zeichen nach bzw. vor Backslashes usw. Sollte dir schon weiterhelfen. Wenn es auch nur ein Hinweis auf Funktionen ist die verwendet werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/927868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/927868</guid><dc:creator><![CDATA[GreyHound]]></dc:creator><pubDate>Sat, 26 Nov 2005 18:18:46 GMT</pubDate></item><item><title><![CDATA[Reply to String in Häppchen unterteilen? on Sat, 26 Nov 2005 19:46:13 GMT]]></title><description><![CDATA[<p>danke euch beiden <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/927952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/927952</guid><dc:creator><![CDATA[std::string]]></dc:creator><pubDate>Sat, 26 Nov 2005 19:46:13 GMT</pubDate></item><item><title><![CDATA[Reply to String in Häppchen unterteilen? on Sat, 26 Nov 2005 23:37:17 GMT]]></title><description><![CDATA[<p>Warum nimmst du nicht einfach ForceDirectories?<br />
Zitat aus de Hilfe:</p>
<blockquote>
<p>ForceDirectories erstellt ein neues Verzeichnis (bei Bedarf werden auch die übergeordneten Verzeichnisse angelegt).</p>
<p>Unit<br />
SysUtils<br />
oder FileCtrl</p>
<p>extern PACKAGE bool __fastcall ForceDirectories(AnsiString Dir);</p>
<p>Beschreibung<br />
ForceDirectories erstellt das in Dir vollständig angegebene Verzeichnis. Sind die übergeordneten Verzeichnisse nicht vorhanden, werden diese automatisch angelegt. ForceDirectories gibt den Wert true zurück, wenn alle notwendigen Verzeichnisse erfolgreich erstellt wurden. Andernfalls wird false zurückgegeben.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/928077</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/928077</guid><dc:creator><![CDATA[-**xXx**-]]></dc:creator><pubDate>Sat, 26 Nov 2005 23:37:17 GMT</pubDate></item></channel></rss>