wie kann ich einen string an einer beliebigen Stelle teilen
zBsp. string = "abcdefghij"
dann soll string1 = "abcd" und string2 = "efghij" sein
danke
String an bestimmter Stelle teilen
Re: String an bestimmter Stelle teilen
Nichts leichter als das:
<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">
std::string str = "abcdefghij";
std::string str1 = str.substr(0, 4); // = "abcd"
std::string str2 = str.substr(4, str.length()); // = "efghij"
</font><hr></pre></blockquote>
c ya,
Tobias
<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">
std::string str = "abcdefghij";
std::string str1 = str.substr(0, 4); // = "abcd"
std::string str2 = str.substr(4, str.length()); // = "efghij"
</font><hr></pre></blockquote>
c ya,
Tobias
Last edited by tkortkamp on 11. Jul 2002 0:01, edited 1 time in total.
dude i'm pretty damn sure you could script somebody back to life