FlyBoy Posted September 20, 2004 Posted September 20, 2004 im kinda newbie to c++... i have a question about strings... i want to connect to strings... i have this string* str1; i have this : "Joe" and "fly" i want str1 to be equal to "Joe Fly" a simple way in vbnet is. dim str1 as string str1="joe" & "fly" how to do it in vc++net??? and another question...how to add new lines? (like in vbnet..Vbcrlf,or vbnewline)??? Quote
Leaders dynamic_sysop Posted September 20, 2004 Leaders Posted September 20, 2004 i assume you are using managed C++ ( windows forms ) , here's one way... String * str = "Joe "; String * str1 = "Fly"; String * str2 = "\nSome stuff on a newline"; /// \n being a new line String * result = String::Concat(str,str1,str2); /// String::Concat joins an array of strings together MessageBox::Show(result); Quote
FlyBoy Posted September 21, 2004 Author Posted September 21, 2004 i assume you are using managed C++ ( windows forms ) , here's one way... String * str = "Joe "; String * str1 = "Fly"; String * str2 = "\nSome stuff on a newline"; /// \n being a new line String * result = String::Concat(str,str1,str2); /// String::Concat joins an array of strings together MessageBox::Show(result); 10x!!!! it works... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.