- This topic has 12 replies, 9 voices, and was last updated 13 years ago by GODFATHER-GM_01.
-
AuthorPosts
-
November 10, 2006 at 1:32 pm #191358NewbieMember
😀
#include #include #include
November 10, 2006 at 1:54 pm #191370GODFATHER-GM_01Memberguys whats so deaf about c++ and vb6 what dose c++ do?
November 10, 2006 at 2:46 pm #191369BattleStar-GalacticaMemberfunction replaceElement() { //The first child of the div is the bold element. var oChild=Div1.children(0); var sInnerHTML = oChild.innerHTML; if (oChild.tagName=="B") { oNewChild=document.createElement("I"); Div1.replaceChild(oNewChild, oChild); oNewChild.innerHTML=sInnerHTML } else { oNewChild=document.createElement("B"); Div1.replaceChild(oNewChild, oChild); oNewChild.innerHTML=sInnerHTML } }
Click anywhere in this sentence to toggle this word
between bold and italic.November 10, 2006 at 7:15 pm #191368AdminAdministrator@VINNIE-GM_01 wrote:
guys whats so deaf about c++ and vb6 what dose c++ do?
C++ is a much more powerful coding language…u can do a lot more with it….sky is the limit if u really know wut ur doin….but its a lot harder to learn…..i havnt got past VB lol…. 😆
November 10, 2006 at 10:55 pm #191367PoniesMember‘sky’ inst all that big you know.
November 10, 2006 at 11:19 pm #191366AdminAdministratorbut your mom is.
November 11, 2006 at 1:14 am #191365AdminAdministratorlol…..if u keep going up u end up in outer space…lol…. 😆
November 11, 2006 at 2:47 am #191364PoniesMemberwitch is VERY big. But isn’t the sky.
November 11, 2006 at 3:08 am #191363AdminAdministratorits an extension of the sky 😀
September 27, 2010 at 7:02 am #191362DexterMemberThe basic has a function called “Replace” which takes 3 strings and does as i described. I looked at the string::replace but none of its forms can take the 3 stings and do the job. If i use a position and size then surely if the replacer is longer than the replace-ee then thats going to overwrite more than i want it too :/ Plus im not sure how to even get the position or length i need either
#include #include #include #include using namespace std; string Replace(string a,string b,string c) { int pos = a.find(b); a.replace(pos, c.length(), c); return a; } int main() { std::cout << Replace(" Hello World","Hello","goodbye"); }
This is my attempt but i am getting
goodbyeorldAs its simply overwriting rather than resizing a.
edit:
Ah ok fixed it, i needed to supply the length of b. Now i just need to make it parse the whole string 🙂Is this the best way of doing this? by (dman (20) )
September 27, 2010 at 5:26 pm #191361StringMemberDexter, do not post data from other forums with out posting a link back to the original forum.
September 28, 2010 at 6:36 pm #191360ChikeMemberThis looks like a sophisticated spam bot.
Only took it 3 minutes from his hello post to this one.
And of course the n00b has a link in his sig LOL.January 7, 2011 at 9:53 am #191359waqar_khanMemberHello guys….!
Really nice code shared.Great work.I really appreciate your work.I really like this kind of post which tell us much important information. …! -
AuthorPosts
Related
- You must be logged in to reply to this topic.