<?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 auslesen und löschen]]></title><description><![CDATA[<p>Ich hab einen String<br />
Ich suche ein bestimmtes Zeichen &quot;§&quot;</p>
<p>Beispiel String:</p>
<blockquote>
<p>abcdefg§hijklmnop</p>
</blockquote>
<p>Nun soll er alles was sich rechts vom § rechts befindet, löschen!<br />
Also es soll dann</p>
<blockquote>
<p>abcdefg§</p>
</blockquote>
<p>stehen</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/249087/string-auslesen-und-löschen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 16:19:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/249087.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Sep 2009 14:48:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 14:48:30 GMT]]></title><description><![CDATA[<p>Ich hab einen String<br />
Ich suche ein bestimmtes Zeichen &quot;§&quot;</p>
<p>Beispiel String:</p>
<blockquote>
<p>abcdefg§hijklmnop</p>
</blockquote>
<p>Nun soll er alles was sich rechts vom § rechts befindet, löschen!<br />
Also es soll dann</p>
<blockquote>
<p>abcdefg§</p>
</blockquote>
<p>stehen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1770966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1770966</guid><dc:creator><![CDATA[Dobyasd]]></dc:creator><pubDate>Wed, 02 Sep 2009 14:48:30 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 14:51:35 GMT]]></title><description><![CDATA[<p>Schön. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1770967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1770967</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Wed, 02 Sep 2009 14:51:35 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 14:52:43 GMT]]></title><description><![CDATA[<p>Hallo,<br />
schau dir mal folgende Methoden an:</p>
<p>insert(), erase(), find(),replace()...</p>
<p>Alle haben sehr einfache Syntax und somit leicht zu erlernen. Dann ist dein Problem ein Kinderspiel!</p>
<p>lg, freakC++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1770969</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1770969</guid><dc:creator><![CDATA[freakC++]]></dc:creator><pubDate>Wed, 02 Sep 2009 14:52:43 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 14:53:33 GMT]]></title><description><![CDATA[<p>Dobyasd schrieb:</p>
<blockquote>
<p>Ich hab einen String<br />
Ich suche ein bestimmtes Zeichen &quot;§&quot;</p>
<p>Beispiel String:</p>
<blockquote>
<p>abcdefg§hijklmnop</p>
</blockquote>
<p>Nun soll er alles was sich rechts vom § rechts befindet, löschen!<br />
Also es soll dann</p>
<blockquote>
<p>abcdefg§</p>
</blockquote>
<p>stehen</p>
</blockquote>
<p><a href="http://www.cplusplus.com/reference/string/string/" rel="nofollow">http://www.cplusplus.com/reference/string/string/</a></p>
<p>Ein wahres Hexenwerk diese Referenz, man sollte einen Exorzist rufen !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1770970</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1770970</guid><dc:creator><![CDATA[Icematix]]></dc:creator><pubDate>Wed, 02 Sep 2009 14:53:33 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 14:56:13 GMT]]></title><description><![CDATA[<p>Einfach ne Forschleife Hochzählen bis zum Auftreffen deines Zeichens<br />
Falls gefunden Zählerschleife+1, ein \0 einfügen fertig. Löscht zwar dein Klammote nicht wirklich. Nur bei der Ausgabe wird es dich nicht mehr stören.</p>
<p>Oder Forschleife<br />
kopiere jedes Element einschliesslich dein § in ein array, fertig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1770974</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1770974</guid><dc:creator><![CDATA[Cefour]]></dc:creator><pubDate>Wed, 02 Sep 2009 14:56:13 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 15:04:45 GMT]]></title><description><![CDATA[<p>Cefour schrieb:</p>
<blockquote>
<p>Einfach ne Forschleife Hochzählen bis zum Auftreffen deines Zeichens<br />
Falls gefunden Zählerschleife+1, ein \0 einfügen fertig. Löscht zwar dein Klammote nicht wirklich. Nur bei der Ausgabe wird es dich nicht mehr stören.</p>
</blockquote>
<p>Glaubst du wirklich, das funktioniert?</p>
<pre><code class="language-cpp">std::string s = &quot;abcdefg$hijklmnop&quot;;
for(int i = 0; i &lt; s.size(); ++i)
{
    if(s[i] == '$')
    {
        if(i + 1 &lt; s.size())
        {
            s[i + 1] = '\0';
        }
        break;
    }
}
std::cout &lt;&lt; s &lt;&lt; std::endl;
</code></pre>
<p>Ausgabe: abcdefg$ijklmnop</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1770978</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1770978</guid><dc:creator><![CDATA[Ryuzaki]]></dc:creator><pubDate>Wed, 02 Sep 2009 15:04:45 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 15:39:03 GMT]]></title><description><![CDATA[<p><code>std::string s(&quot;asdfgh$asdfghklj&quot;);</code><br />
<code>s.erase(++ std::find(s.begin(), s.end(), '$'), s.end());</code></p>
<p>bb</p>
<p>PS:</p>
<blockquote>
<p>Ausgabe: abcdefg$ijklmnop</p>
</blockquote>
<p>bestimmt mit gcc^^<br />
msvc gibt mir das hier aus:<br />
<code>abcdefg$ ijklmnop</code></p>
<p>weiß aber nicht, ob der standard was darüber schreibt, wie '\0' darzustellen ist <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";D"
      alt="😉"
    /> iwie ist ja beides logisch^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1770997</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1770997</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Wed, 02 Sep 2009 15:39:03 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 16:26:34 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/16305">@unskilled</a>: Ich würde sicherheitshalber aber noch ein &quot;if&quot; dazwischenschieben, falls der String wider allen Erwartens doch kein '$' enthält. Sonst wird ja einfach alles gelöscht (bei npos==-1). Und ich bin mir auch nicht sicher, ob &quot;++&quot; hier funktioniert, müssten der Rückgabewert von &quot;find&quot; nicht ein R-Value sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1771028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1771028</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Wed, 02 Sep 2009 16:26:34 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Wed, 02 Sep 2009 19:26:08 GMT]]></title><description><![CDATA[<p>Hey leute,<br />
das mit der for-Schleife sehe ich als Schwachsinn hier an, denn man kann es sich mit den ganz normale Stringmethoden total einfach machen. So wie es unskilled gemacht hat!!</p>
<p>lg, freakC++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1771115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1771115</guid><dc:creator><![CDATA[freakC++]]></dc:creator><pubDate>Wed, 02 Sep 2009 19:26:08 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Thu, 03 Sep 2009 11:15:53 GMT]]></title><description><![CDATA[<p>Wobei das durch die string-Routinen intern sicher auch nicht viel anders als über eine Schleife funktioniert.<br />
Der Code von Unskilled sieht natürlich einfach geiler aus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1771472</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1771472</guid><dc:creator><![CDATA[It0101]]></dc:creator><pubDate>Thu, 03 Sep 2009 11:15:53 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Thu, 03 Sep 2009 12:15:06 GMT]]></title><description><![CDATA[<p>Badestrand schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/16305">@unskilled</a>: Ich würde sicherheitshalber aber noch ein &quot;if&quot; dazwischenschieben, falls der String wider allen Erwartens doch kein '$' enthält. Sonst wird ja einfach alles gelöscht (bei npos==-1). Und ich bin mir auch nicht sicher, ob &quot;++&quot; hier funktioniert, müssten der Rückgabewert von &quot;find&quot; nicht ein R-Value sein?</p>
</blockquote>
<p>Japp, das if würd ich eigtl auch reinmachen ^^<br />
Dachte ich eigtl auch (R-Value) aber es geht - zumindest im MSVC ^^</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1771505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1771505</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Thu, 03 Sep 2009 12:15:06 GMT</pubDate></item><item><title><![CDATA[Reply to String auslesen und löschen on Thu, 03 Sep 2009 14:17:16 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<p>Dachte ich eigtl auch (R-Value) aber es geht - zumindest im MSVC ^^</p>
</blockquote>
<p>Heißt ja nicht unbedingt dass es auch immer gehen <em>darf/sollte/muss</em> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1771613</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1771613</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 03 Sep 2009 14:17:16 GMT</pubDate></item></channel></rss>