<?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[Stringbearbeitung und replace]]></title><description><![CDATA[<p>Ich will eine Quelldateiname als string bearbeiten, so dass die Erweiterung (entweder .h oder .hpp) weg ist. Nehmen wir an, dass ich &quot;hallo.h&quot; habe. Dann muss es zu &quot;HALLO_GUARD&quot; werden.<br />
Ich habe folgendes Porgamm geschrieben, ob es funkzioniert, weiß ich nicht:</p>
<pre><code class="language-cpp">string start = &quot;myheader.h&quot;; //hier kann es auch .hpp sein!
transform(start.begin(), start.end(), start.begin(), std::toupper);
start.replace(start.find(&quot;.&quot;), &quot;_GUARD&quot;);
cout &lt;&lt; &quot;#ifndef &quot; &lt;&lt; start &lt;&lt; endl;
cout &lt;&lt; &quot;#define &quot; &lt;&lt; start &lt;&lt; endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/150439/stringbearbeitung-und-replace</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 16:10:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/150439.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Jun 2006 13:36:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:36:26 GMT]]></title><description><![CDATA[<p>Ich will eine Quelldateiname als string bearbeiten, so dass die Erweiterung (entweder .h oder .hpp) weg ist. Nehmen wir an, dass ich &quot;hallo.h&quot; habe. Dann muss es zu &quot;HALLO_GUARD&quot; werden.<br />
Ich habe folgendes Porgamm geschrieben, ob es funkzioniert, weiß ich nicht:</p>
<pre><code class="language-cpp">string start = &quot;myheader.h&quot;; //hier kann es auch .hpp sein!
transform(start.begin(), start.end(), start.begin(), std::toupper);
start.replace(start.find(&quot;.&quot;), &quot;_GUARD&quot;);
cout &lt;&lt; &quot;#ifndef &quot; &lt;&lt; start &lt;&lt; endl;
cout &lt;&lt; &quot;#define &quot; &lt;&lt; start &lt;&lt; endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1078936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078936</guid><dc:creator><![CDATA[khalderon]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:36:26 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:42:19 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078945</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078945</guid><dc:creator><![CDATA[:confused:]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:42:19 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:46:11 GMT]]></title><description><![CDATA[<p>wieso weißt du nicht ob es funktioniert?</p>
<p>naja, trotzdem fehlt bei replace nen parameter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078946</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078946</guid><dc:creator><![CDATA[ser1al]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:46:11 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:44:01 GMT]]></title><description><![CDATA[<p>Weil ich das Quellkode immer noch schreibe. Könnten sie so gut sein und mir helfen? Bitte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078947</guid><dc:creator><![CDATA[khalderon]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:44:01 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:45:24 GMT]]></title><description><![CDATA[<p>Biste besoffen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078948</guid><dc:creator><![CDATA[:confused:]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:45:24 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:46:18 GMT]]></title><description><![CDATA[<p>Das funktioniert schon deswegen nicht, weil replace mindestens 3 Parameter erwartet.<br />
eher so</p>
<pre><code class="language-cpp">string start = &quot;myheader.h&quot;; //hier kann es auch .hpp sein!
transform(start.begin(), start.end(), start.begin(), std::toupper);
string::size_type pos = start.find_last_of(&quot;.&quot;);
start.replace(pos, start.size() - pos + 1, &quot;_GUARD&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1078950</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078950</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:46:18 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:47:06 GMT]]></title><description><![CDATA[<p>Zdravko schrieb:</p>
<blockquote>
<p>Weil ich das Quellkode immer noch schreibe. Könnten sie so gut sein und mir helfen? Bitte.</p>
</blockquote>
<p>naja die spracherkennung funktioniert auch schlecht im aktuellen c++ standard <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078951</guid><dc:creator><![CDATA[ser1al]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:47:06 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:51:43 GMT]]></title><description><![CDATA[<p>Braunstein, danke sehr. Das wird mir sicherlich helfen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078955</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078955</guid><dc:creator><![CDATA[khalderon]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:51:43 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 13:53:38 GMT]]></title><description><![CDATA[<p>Zdravko scheint aus Bulgarien zu kommen, da kann man das mit der Sprache schon verstehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078956</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 16 Jun 2006 13:53:38 GMT</pubDate></item><item><title><![CDATA[Reply to Stringbearbeitung und replace on Fri, 16 Jun 2006 14:05:06 GMT]]></title><description><![CDATA[<p>Verwende doch einfach <a href="http://www.boost.org/libs/algorithm/string/index.html" rel="nofollow">http://www.boost.org/libs/algorithm/string/index.html</a><br />
anstatt die gleichen Algos immer und immer wieder neu zu schreiben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078960</guid><dc:creator><![CDATA[Dr. Prof]]></dc:creator><pubDate>Fri, 16 Jun 2006 14:05:06 GMT</pubDate></item></channel></rss>